We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31088
    • 14 Posts
    Quote from: ottogal at Nov 18, 2008, 09:13 AM

    For beginners the following remarks may be helpful to understand Wayfinder placeholders.

    etc...

    Thank you for posting that, it was quite helpful to me.
    I am brand new to Modx (and cms’s in general actually, I always built my own admin pages before, but this is wayyyy better wink ) and this helped me understand a couple of things which had stumped me.

    However, I am wondering if anyone has any reading tips on hiding and un-hiding subitems in the menu, and things like that? Tutorials or whatnot which might go into a bit more depth on constructing a wayfinder-compatible expanding menu from scratch - not so much the fancy JS powered ones, although they are very nice, just a pure CSS one from the beginning?

    I have put one together myself, and whle it works nicely, it seems a bit convoluted and inelegant; I’m sure there are cleaner ways to do it.

    I will mention what I did, in case it matters:
    basically the css class for the third <ul> into a constructed menu is hidden by default, and I use parentHereClass to add a class which has display:block...

    so specifically, how can I avoid doing
    .navigation ul li ul li ul li{
    display:none;
    }
    .navigation .selected{
    display:block;
    }
    

    ??
    It’s that first one that gets me... it just seems funky somehow. The kind of code that flies apart under stress leaving little bits of markup shrapnel...

    And since it’s my first post, thanks to all for such a good forum. smiley I hope I can return the favour of help to another newbie some day soon.
    • Updated the new wiki a bit over at http://svn.modxcms.com/docs/display/ADDON/Wayfinder

      I’ll read through the German site later to see if there’s anything missing. (from this post I already know &config needs to be added)


      I also noticed the tutorials for making accordeon menus aren’t on the new wiki yet. Is there anything else that should be in the documentation but isn’t? Other tutorials perhaps?

      Does anyone know differences between the Evo and Revo versions that should be listed on the wiki?
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 5368
        • 6 Posts
        I was trying to pull template variables from my documents but didn’t see an example on how this is done. For example, I created a tv for a navigation image on my top level items. Not sure if this is the best way to approach it, but still trying to learn revo/modx. So many different ways to slice and dice this cms/cmf, it’s not always clear the best way to get something done. Anyway, after digging in the wayfinder snippet, I saw how to add template variables into the wayfinder call.

        I have a template variable called navImage. Created a chunk for the wayfinder row template to contain:

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


        Placeholder call: [[+template variable name]] was all I needed. Very simple, but didn’t see an example of calling a template variable in wayfinder. Figured I’d share. Cheers.
          - Chris Jewitt
          Apteric Technologies
          www.apteric.com
          • 6506
          • 35 Posts
          After posting something before for wayfinder (dropline menu) I thought I would also share this. After searching for an accordion menu for wayfinder I found various examples, and although helpful they were not exactly what I needed. So I thought I would share this simple accordion menu using wayfinder, jquery and the ddaccordian.

          First of all you need to download one of the excellent accordion menus from Dynamic Drive http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu.htm, I used the ’Urban gray accordion menu for this example’.

          Attach the ddaccordion.js file into the head of your document. Create another js file and add the config script and attach this to the head of your document. I called mine common.js as it will be used for anything common to all pages of the site.

          Add the css to your navigation/menu css file or in the head of your template if your prefer.

          Now comes the bit that adds the functionality.

          Go to the \assets\snippets\wayfinder\configs folder for your site. Create a new config file, I called mine accordian.config.php and add the following code

          <?php
          	$level = 2;
          	
          	$parentClass = '';
          	$rowClass = '';
          	$selfClass = ''; 
          	$innerClass = '';
          	$outerTpl = '@CODE:<div id="nav">
          					[+wf.wrapper+]
          					</div>';
          					
          	$activeParentRowTpl = '@CODE:<h3 class="headerbar selected">
          	<a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>
          	</h3>
          	<ul  class="submenu">[+wf.wrapper+]</ul>
          	'; 
          	
          	$innerTpl = '@CODE:[+wf.wrapper+]';
          	
          	$parentRowTpl = '@CODE:<h3 class="headerbar"><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a></h3>
                  <ul  class="submenu">[+wf.wrapper+]</ul>';
          	
          	$innerRowTpl = '@CODE:<li [+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>
          	[+wf.wrapper+]</li>';
          
                $rowTpl = '@CODE:<h3 class="headerbar"><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a></h3>[+wf.wrapper+]';  
          	
                                 
          ?>
          


          Then your wayfinder call is just
          [!Wayfinder? &startId=`0` &config=`accordian`!]


          That’s it, your accordian should work. Edit the navigation config in your common.js file with the settings you want. As the js persists the header through the page session the correct item is open as you navigate to each section.

          Hope this helps someone. laugh
            • 28189
            • 47 Posts
            Wayfinder 2.1.3 rc2 (Revolution 2.0.5-pl (traditional))

            The outerTpl template is being applied to all <ul> tags in the nav.

            My Snippet:

            [[Wayfinder? &startId=`0` level=`2` &outerTpl=`WayfinderOuterTpl`]]
            



            My Tpl:

            <ul class="mlddm" params="0,0,200,fade,150,h,1,200,1,0">[[+wf.wrapper]]</ul>
            



            ???

              • 22427
              • 793 Posts
              huh
              As far as I know there is no attribute [tt]params[/tt] for the <ul> element...
                • 21838
                • 284 Posts
                ensure to give all parameters a ’&’. You didn’t for ’level’…
                  MODX Free Template Base: MODX-Boilerplate | my blog (lots of MODX stuff) | my gitHub (translations) | MODX User Groups Germany (Facebook)
                  • 28189
                  • 47 Posts
                  Quote from: ottogal

                  huh
                  As far as I know there is no attribute [tt]params[/tt] for the <ul> element...

                  I know, but that’s what the dropdown lib calls for (which is a very nice one). Most likely unrelated to my problem.

                  Quote from: ottogal

                  ensure to give all parameters a ’&’. You didn’t for ’level’…

                  Indeed, that was a typo. The actual snippet call is correct and has the &.


                    • 22427
                    • 793 Posts
                    So what is your problem? No output at all? What is the output, if any?
                      • 8609
                      • 607 Posts
                      i’ve run into this issue before, you may need to create an innertpl chunk too