%asset_is_first% should behave how you want as along as the Asset Listing Page has List Format set to “Custom Grouping” (and possibly enable “Group assets by direct parent asset” in the Asset Grouping screen if pertinent).
I just tested (on 5.5.1.5) and got the expected results from both %asset_is_first% and %asset_page_position%
What about using two groups? The first creates the wrapping div, with asset positions available via the first group’s body copy. The second group renders the content.
When you say two groups, do you mean 2 x asset listers nested?
I’m rebuilding (streamline) the menu for this site and the fewer overheads the better…
Cheers
N
No, I’m using a combo of static HTML nested with asset Listing and caching using esi: url include.
I don’t think I can achieve that level of menu structure within the design file - or not that I’m aware of.
Correct John
I’m trying to check if a group is the first group not the items within the the first group.
so you can see the the embed image (inspector) the first group id=“national_variety_trials” class=“tabcontent” I was trying to add class=“tabcontent show”. I’m currently using javascript along with CSS but I thought it would be more manageable by just targeting the first group with some simple css.
Kinda weird that there’s no keyword to get the index for a group (is this correct SQUIZ?)
Belated thought, in the spirit of “don’t solve the problem you have, solve an easier problem that makes that problem go away”, depending on your markup it might be possible to replace the whole thing with a positional CSS selector.
.tabcontent:first-child instead of .tabcontent.show
(there’s no undocumented keywords in the grouping code that I can see, I think it has just never come up)
Yeah, I did already use tabcontent:first-child but because the way things get sorted in Matrix - if the sorting is out of whack then the first-child may not be the correct corresponding active tab /tab contents.
Cheers
N