We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Need help capturing the first and subsequent menu items of a dropdown in a menu.

  • #5373
    Avatar photo[anonymous]

    Stylistically, your menu is not compatible with the menu I have designed. Close … but no cigar! Actually damned close! Still no cigar. I only have to insert one nav tag and style the menu links differently for single menu links, the first “visible” menu link, and the subsequent drop-down links.

    Easy peasy right? Not when you are tired and need a nap apparently.


    {{#each items}}

    … in menu.hbs…

    I would like to detect the first, subsequent, and last links of a dropdown set of menu links.

    Assume this dropdown,


    1 bedroom apartment

    2 bedroom apartment

    duplex house

    single-family house

    I need to style the vacancies menu link, insert a nav between vacancies and 1 bedroom apartment menu links, and style differntly each item 1 bedroom apartment, 2 bedroom apartment, duplex house, single-family house menu links.

    Clear as mud?

    How can I reliably detect each of these?

    Does “items” in the code sample have, for example, items.count and others?

    Or is there something else I can use?

    I have tried several things, way too many to recall here.