We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36604
    • 268 Posts
    Hi,


    BAck with my tricky menu.

    Using Babel I have one big difference between the default context menu (fr) and the alternate language context (en).
    in the first case WF does not outputs the current home page link in the menu list (that looks pretty normal, but maybe not) and for the english home page it display a "home" (.active) link.

    As this call is not conventional, i dont understand what is what about this home link presence or not depending on context.

    Actually the home page gather the home page's child content, injects it into itself and build anchors links to #name of those sections in the main menu, plus a couple of classic real links to first level sibling pages.
    the behaviour is partially like a "one page site".
    I managed to complete this, but whatever i tried the EN version menu have a home link as the default (fr) page does not.
    it gives : anchor1 anchor2 anchor3 link-to-page1 link-to-page2

    in the en context it gives:
    home (self) anchor1 anchor2 anchor3 link-to-page1 link-to-page2

    To do some test I changed my WF call to differentiate it (but I think it's useless):
    [[[[++cultureKey:=`fr`:then=`$callWFH-fr`:else=`$callWFH-en`]]]]

    &startId=`0` is mandatory, instead nothing comes into the menu
    I thought it could be 1 (fr home) or 3 (en home)

    $callWFH-fr
    [[Wayfinder? &startId=`0` &level=`2` 
    &startItemTpl=`WF-homeTPL` &displayStart=`1` 
    &rowIdPrefix=`go_` &outerTpl=`WF-outerTpl` 
    &parentRowTpl=`WF-menuH-parentRowTpl` 
    &innerTpl=`WF-innerTplFLAT` &innerRowTpl=`WF-menuH-innerRowTpl` 
    &rowTpl=`WF-rowTpl0` 
    &excludeDocs=`25,33`]]

    the excludeDocs are some sub pages I don't wanna see in the menu (their equivalent don't exist yet in the EN version)
    includeDocs=1 if present the menu is empty

    $callWFH-en
    [[Wayfinder? &startId=`0` &level=`2`
     &startItemTpl=`WF-homeTPL` &displayStart=`1` 
    &rowIdPrefix=`go_` &outerTpl=`WF-outerTpl` 
    &parentRowTpl=`WF-menuH-parentRowTpl`
     &innerTpl=`WF-innerTplFLAT` &innerRowTpl=`WF-menuH-innerRowTpl`
     &rowTpl=`WF-rowTpl0` 
    &excludeDocs=`25,33` &includeDocs=`3`]]
    includeDocs=3 present or not, does not change anything


    <!-- innerRowTpl -->
    <li role="menuitem" [[+wf.id]][[+wf.classes]]><a id="go[[+wf.docid]]"  class="[[+wf.classnames]] local" href="#[[+wf.title]]" title="[[+wf.longtitle]]">[[+wf.linktext]]</a>[[+wf.wrapper]]</li>


    Thak you
    • For one thing, the &displayStart property is useless here, your startId is 0 (root level) so there is no start to display.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 36604
        • 268 Posts
        Quote from: sottwell at Dec 02, 2014, 02:52 PM
        For one thing, the &displayStart property is useless here, your startId is 0 (root level) so there is no start to display.
        ok, thank you.

        but I still don't see why there's a home link on the home En, as there's not this one in default cx (fr)

        If I delete this &startId=`0` from the call, thn nothing os output...
        • By default Wayfinder will try to use the current resource as the startId. If that resource has no children, then there won't be a menu.

          What, exactly, do you mean by a "home link"? If your site_start page has an alias of "index", then you won't be seeing domain.com/index.html, just domain.com.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 36604
            • 268 Posts
            Quote from: sottwell at Dec 02, 2014, 05:54 PM
            By default Wayfinder will try to use the current resource as the startId. If that resource has no children, then there won't be a menu.

            What, exactly, do you mean by a "home link"? If your site_start page has an alias of "index", then you won't be seeing domain.com/index.html, just domain.com.

            'Home' link is a link to the home page (shop.domain.fr for the default one [fr] landing on 'accueil' (id 1 page) and shop.domain.fr/en/ for the alternate EN (other context), landing on 'home' (id 3 page) ).

            the ressources tree looks like this:

            WEBSITE (default CX for FR part)
            -accueil (fr home) (id 1)
            -boutique (fr 'shop')
            |_ main cat1
            |_sub cat1.1
            |_sub cat1.2
            -other
            -other

            ------------------------
            WEBSITE EN (second CX for EN part)
            -home (id 3)
            -shop
            |_ main cat1
            |_sub cat1.1
            |_sub cat1.2
            -other
            -other