Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Check Class Type of Children


Go to End


1256 Views

Avatar
Sajan

Community Member, 13 Posts

30 April 2016 at 11:01pm

Edited: 30/04/2016 11:02pm

Hey guys,

My SiteTree has the following structure:

- Category (Level 1)
    - Category (Level 2)
        - Product
    - Category (Level 2)
    - Category (Level 2)
- Category (Level 1)

I am trying to setup a Multi-Level Accordion Menu. I want to check somehow if the menu item should be linked or un-linked by knowing the ClassName of the Child page(s)

Eg.
If the Children Pages of the Category are products it should be linked, otherwise un-linked.

Is there a way for me to check the ClassName of the Child Page(s) to know whether this parent of the child should be linked or unlinked?