We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26834
    • 22 Posts
    Quote from: mrhaw at Dec 30, 2008, 06:20 AM

    You miss a correct closing in your call ---> ]] not ]

    Oops, that was as I copied it, it’s there in the code.

    Thank you! I’ve not got it working exactly how I want it.
      • 20413
      • 2,877 Posts
      Sweet! smiley
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 16183
        • 1,390 Posts
        Quote from: sg1psychopath at Dec 30, 2008, 07:06 AM

        Thank you! I’ve not got it working exactly how I want it.

        Glad to see your menu is working. I have noticed a couple of things though which might give you problems.

        1. The parentRowTpl is a row level template. Row level templates basically output the row/list items of your menu - the <li></li> of your menu. Looking at your code above, you have

        <ul id="distleftnav">
            <li id="distleftnavparent"><a href="[+wf.link+]">[+wf.linktext+]</li>
        </ul>


        This might cause problems. It means, for every document in your menu that is a parent, WF will enclose it in the above tags. There is no problem with the above placeholders. The problem is with the ids and the <ul>. I suppose your menu has more than one parent document. Using the code above, each of these will be given the same id; first they will have <ul></ul> tags around them with the id "distleftnav". Secondly, they will be enclosed within <li></li> tags each with the id "distleftnavparent". You see where am getting at? To get correct (X)HTML you cannot assign a single id to multiple elements

        2. In WF, the innerTpl is very similar to the outerTpl. If you have defined it, it will be used to construct the outermost container for sub-menus. With regard to the innerTpl, the outermost basically means the <ul></ul> tags around sub-menu items. If you do not define and innerTpl, WF will use its in-built outerTpl to construct the container of your sub-menus. If you have defined the innerTpl then, the outerTpl will only be used as the container of the outermost level of your menu. What am I getting at?  I think the way you created your innerTpl may cause problems with your menu. You have your code like so:

        <li><a href="[+wf.link+]">[+wf.linktext+]</li>


        The above code does not have the <ul></ul> needed to enclose your sub-menu items.

        3. Note that since you have not defined an outerTpl, WF will use its default one to build the container of the highest level of your menu. The default WF outerTpl looks like so:

        <ul [+wf.classes+]>
        [+wf.wrapper+]
        </ul>


        4. Note also that since you have not defined the required template rowTpl, behind the scenes, WF is using its default one to build the row items of your menus that are not parents (since you have defined a parentRowTpl). The default WF rowTpl looks like so:

        <li[+wf.id+][+wf.classes+]>
        	<a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>
        	[+wf.wrapper+]
        </li>


        OK, now to my suggestions:

        1. You may want to define an outerTpl for your menu if you don’t want to use the default WF one. This will allow you to give a unique id to the outermost container of your menu if you wish. Depending on the structure of website’s template, it may not be necessary to give it an id anyway. E.g. you may have placed your WF call in a div which already has an id- OK - I digress. Just note that if you define an outerTpl and give an id to the <ul> in that template, then it is advisable to also define an innerTpl for the reasons I have described above. So, if you decide to do this, then your outerTpl might look like so:

        <ul id="distleftnav"[+wf.classes+]>[+wf.wrapper+]</ul>


        Your whole menu will be contained within the above template.

        2. You probably want to redo your parentRowTpl like so:

        <li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>[+wf.wrapper+]</li>  


        You can style the parent items using the CSS classes generated by WF. Same goes for the other bits of your menu

        3. And finally, your innerTpl could look something like so:

        <ul[+wf.classes+]>[+wf.wrapper+]</ul> 


        I hope I haven’t been presumptuous. Sorry for the long post wink Hope it helps though.

        cheers/k
          • 26834
          • 22 Posts
          Thanks kongondo. It seems that although it’s working as I want it, I haven’t actually done things the way they should be done. I’ll have a go at your suggestions and hopefully get it all working properly.