<ul> <li><a href="" title="News Blog" class="">xxxx</a></li> <li><a href="/fulfilment" title="" class="">Fulfilment</a></li> <li><a href="/return-service" title="" class="">Return Service</a></li> <li><a href="/blog-preview" title="" class="">Blog</a></li> <li><a href="/contact-de" title="" class="">CONTACT</a></li> </ul>
This question has been answered by multiple community members. See the first response.
href="[[~5]]"
[[~[[+id]]]]
Hi gerard9,
Welcome to the MODX forums!
You can link to resources by inserting [[~id]] and replacing id with the resource id number. So for example if your fulfilment resource has an id number of 5 then you could link to it by using
href="[[~5]]"
If you're trying to create a dynamic menu so that when you add resources to the backend it automatically feeds onto the front end then you should take a look at the wayfinder or pdomenu extra, both of which are really well documented.
[[!Wayfinder? &startId=`12`]]
You can check 'hide from menus' on the current menu items that you don't want wayfinder to pull through. Alternatively you could also exclude the resources you don't want to show with the &excludeDocs property in your wayFinder call.
If neither of those options are any good you could also create a new folder called 'menu' and create weblink resources within it just for the purpose of pulling it through whilst you're remodelling and set the startId to the new menu id.
In MODX there are many ways of doing the same thing
The only practical way to get the the pagetitle (without writing custom PHP code) is to use Wayfinder, pdoMenu, getResources, or something similar.
Wayfinder just shows the resources as they appear in the Resources tree on the left side of the Manager. As LK says, you can hide them by checking the "Hide from Menus" checkbox, or you can drag them somewhere else in the tree so they're not under the parent (or parents) you specified in Wayfinder's &startId property in the Wayfinder tag.
By default, Wayfinder uses the ID of the current page as the startId and shows documents under it, but if you use the &startId property, you can select the parent used for the menu.
This would show resources under resource 12 in the tree:
[[!Wayfinder? &startId=`12`]]
Since you're almost certainly going to use Wayfinder or something similar eventually, I'd recommend using it now. The sooner you get to understand it the better.
Welcome to MODX.