hi,
may i ask a somewhat related question.. i’ve added &hereClass=`active` to Wayfinder so the current <li> looks different, but is there a way to remove the url for the currently active menu item, so it doesnt link to itself?
thanks for the tip, i’ve added &hereTpl=`myhereTpl` to the Wayfinder call:
[!Wayfinder?startId=`0` &hereClass=`active` &hereTpl=`myhereTpl` &selfClass=`current` &outerClass=`sidemenu`!]
then created a chunk named myhereTpl:
<li class="active">[+wf.linktext+]</li>
-
☆ A M B ☆
- 427 Posts
I probably have more experience than anyone using modx, and I am not adverse to:
- Going to the demo site
- Looking through his multiple examples
- Finding one I like
- Create all the chucks in my site
- Reading the page source to get css path and name for his menu
- Grab the css he uses to make the drop down work the way it appears
- Put it all on my site and play with a working version of it
[li]
This is so much better than spending half a day only to find out I was WAY OVER THINKING it.
As a general rule of thumb, I have discovered two things with ModX
- The core items such as ditto and wayfinder have lots of documentation and it takes to long to "discover" the solution you are looking for.
- When I get the answer, I find it was way to easy and I should have known it already.
-
MODX Staff
- 2,502 Posts
Wayfinder is a very powerful snippet. I found it initially to be a challenge. One must drop the programmer when learning how to use snippets. It is about getting the snippet to do what you want (if it is possible). One of the biggest "Doh!" moments came when I realized that all snippets were called exactly the same way. Learning the MODx syntax is one of the biggest hurdles in the process to becoming adept at working quickly.
What I will say learning Wayfinder was that the examples were all using CSSPlay dropdowns which for 90% of the work I do are overkill. It is nice just to generate a unordered list with an active link and a parent class. This is probably the most common menu style there is so trying to figure it out based on the cssplay based examples meant having to disregard lots of the docs and figure it out on my own BUT that really allowed me to understand how to do it. Now I can build Wayfinder menus be it main navigation or a sitemap in my sleep.
As far as documentation is concerned. I used to have the attitude that the devs should write all the documentation but it is actually better for others to contribute as this can lead to better explanations and more thorough documentation that doesn’t assume a base understanding. In addition, programmers are not always able to step far enough out of their application (or snippet) to explain it fully.
Jay
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub