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

    This is probably somewhat elementary for many of you, but I had a hard time finding how to do this, and even had people tell me it wouldn't work - but it finally did smiley

    Here was my original post

    https://forums.modx.com/thread?thread=75598#dis-post-421014

    If I wasn't very good at explaining it, please excuse me. It's easy to picture something in your head - harder to communicate it online.

    So supposing you have a navigation menu, each menu item having submenus (appearing on hover via CSS) but you don't want just the link names in the menu, you also want a picture and description from each article on the submenu to appear there. Perfectly possible, and after hours of pulling my hair out (and server reboots on my crappy shared hosting) I mastered this.

    Here's what we do.

    1) Install phpthumbof under add-ons (to resize the images to the size on our menu, instead of loading a 5 mb picture in a 30px x 30px area)

    2) Create two TV's (or however many based on your needs) - I called mine IntroImage and NavDescription. IntroImage is also the same TV I call at the beginning of my articles, and appears in my menu as well. NavDescription is what should go under the actual link in the title.

    3) Create a chunk called submenuRows with the following content

    <li[[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]"><img src="[[+IntroImage:phpthumbof=`w=30`]]" /> [[+wf.linktext]]</a><br><p>[[+NavDescription]]</p>[[+wf.wrapper]]</li>


    4) Wayfinder Call based on your requirements, but mine looked like this

    [[Wayfinder? &startId=`0` &level=`2` &firstClass=`` &innerClass=`` &lastClass=`` &innerRowTpl=`submenuRows`]]


    I don't know a heck of a lot about wayfinder, but the parts that I believe matter here for this to work are the innerRowTPL=submenuRows part - it calls the chunk we created above, as the template for our submenu.

    I'm sure most people here know this already, but I couldn't find an answer to this on the forums, and decided to post this in the hope of helping some other noob smiley

    Attached (menu.jpg) is an example of what my navigation menu now looks like, using the TV's from each page to input picture and description.

    Hope this helps someone else.

    Greg
      • 35299
      • 1 Posts