I’ve been trying to find a way to use anchors in modx to no avail. When you create an anchor, rather than the link taking you to the specified section on the page, it goes to the homepage. I found some code for a plugin called anchorAway in the forums and tried that (and different variants of it) and still no luck. Does anyone have any idea how to get around this, I can’t believe something as trivial as anchors cant be resolved.
Many thanks.
I use AnchorsAway on several sites and it works great. I recommend the out-of-the box version rather than the contributed ones, at least that is the one I use.
Have you set the plug-in event to OnWebPagePrerender? You need to activate this event in the plug-in settings to make it work (the same with any plug-in).
Can you copy a link to the AnchorAway plugin in the downloads repository for me. I can’t find it from browsing through the respository and even through a search for anchoraway.
thanx
p.s: yes i did check the onwebpageprerender event.
you dont need a plug in, the reason it is going to the front page is probably because you have base url set at the top of your page.
All you need to do is put an [~[*id*]~] e.g:
<a href="[~[*id*]~]#contact-form">contact form</a>
That way even if you change the id of the page, it changes with it.
Now resolved thanks to the tip from Vait.
Wow these posts are from 5 years ago and still in MODx there is no simple solution for this. I agree with Dollyp, how could something so trivial be overlooked?
Chad
@lingokid
See the simple solution posted by Vait referred to in the post just above yours.