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

    I’m trying to realize a menu with a dynamic accordion-effect. Everything works fine in my HTML-Mockup so far. My problem is now that I want to create it in MODx with Wayfinder. I already found some resources on the web about this (e.g. http://wiki.modxcms.com/index.php/Accordion_menu_with_Wayfinder), but all of them require a strict structure. The structure of my page is mixed with containers and pages:
    Home (page with content)
    Office (container without content, is supposed to have the accordion-effect)
     - CV (page with content)
     - Philosophy (page with content)
    Projects (container without content like Office, should have the accordion-effect)
     - Project A (page with content)
     - Project B (page with content)
     - ... (pages with content)
    Links (page with content)
    Contact (page with content)

    You can see what I want here: http://jk-architektur.de/demo/

    Is it possible to implement it with Wayfinder?

    Regards
    Christopher
      • 26016
      • 561 Posts
      Hi,
      Welcome. Ooo, CSS3, very slick, and a very pretty site. smiley Yes, that should be very feasible. You need to template the calls. See this for information:
      http://muddydogpaws.com/development/wayfinder/parameters.html

      At a glance, I’m thinking you would need these parameters:

      for &outerTpl that makes the CSS3-y container:
      <nav>
        [+wf.wrapper+]
      </nav>


      For &parentRowHereTpl, giving the non-link:
      <li[+wf.classes+]>
      	<a href="#">[+wf.linktext+]</a>
      	[+wf.wrapper+]
      </li>
      


      For &innerTpl, making initial children invisible before clicking fires JQuery:
      <ul style="display: none;">
        [+wf.wrapper+]
      </ul>


      The templates are chunks, and they’re referred to in your call, as you’ll see in the documentation link above. That should get you started. Not sure if you’d need an &innerRowTpl, default might work. This is all Evo code, placeholders in Revo are different, I believe they look like this: [[+wf.wrapper]]

      Beyond that, you’ll obviously need to include your libraries for the making the items slide down. I might try this on a site myself!

      Cheers, Dave
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 21286
        • 2 Posts
        Hi Dave,

        thanks a lot! smiley
        That instantly worked. I don’t really understand what exactly is the important thing here yet, but I may figure it out.

        Best Regards
        Christopher
          • 26016
          • 561 Posts
          Christopher,
          Wow, glad to hear that! I should improvise more often. smiley I will keep this in mind, as it’s a really attractive type of menu.

          I actually did a quick test with IE, because I figured the CSS3 stuff would not work, yet it did. Now I see that there is a library to allow rotten IE to handle CSS3, very interesting work-around.

          With Wayfinder, combined with CSS, it’s possible to make nearly any kind of menu, even completely ill-advised ones.

          Cheers, Dave
            MODx and Wordpress development
            Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4