-
MODX Staff
- 12,272 Posts
A weblink doesn’t contain any data, but functions as a symlink to offsite or internal site resources. Think of it as a way to have the same page multiple times in your site or as a way to have external site pages in your dynamic menu systems.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Can you point to an example of it in use, so that I can understand its use in developing new sites.
Is it used in the default installation, for example?
Thanks for any leads.
The shallower you are, the more ground you cover.
-
☆ A M B ☆
- 24,524 Posts
The content of the weblink is just a URL. The parser doesn’t even parse it, as soon as it sees that it is a "reference", it just uses the content as the argument for sendRedirect($url).
You can use an external URL for the content, or you can use a document Id to link to a document in your MODx document tree. (at least in the 0.9.5 beta version you can; in earlier version you must have the complete URL in the weblink’s content)
For example, you want a footer menu with links to a Terms of Use, a Privacy Policy, and stuff like that. But you also want a link to "Contact Us" there. Contact Us is one of your main pages, and is in the top-level of your tree to be displayed in your main menu. You would put those documents in one "utility pages" folder, probably unpublished so it won’t show up in your main menu, and use that folder ID as the docId for the menu snippet. In that folder you would also put a weblink to your site’s contact page. This way the menu will include a link to the contact page, even though that document is not in the folder.
Or, you could do it the other way around, have the Contact Us document in your unpublished "utility pages" folder, and put the weblink to it in your top-level so it will show in the main menu.
Originally a menu snippet would make the link to the weblink document itself, just as to any other MODx document, thus causing the page to be loaded by the parser, triggering the redirect. The latest version of Wayfinder uses the URL in the weblink’s content directly, thus the URL in the menu is that of the desired page (internal to your MODx installation or to an external site) instead of using the URL to the weblink document and requiring the parser to redirect.
-
☆ A M B ☆
- 24,524 Posts
I would, if I could figure out how to create a new page in the wiki!
-
☆ A M B ☆
- 24,524 Posts
Weblinks I’ve done; weblinks I’ve hacked, but a Wiki page I’ve never done before.
-
☆ A M B ☆
- 24,524 Posts