We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29701
    • 0 Posts
    Apologies if this is a stupid question, I’m very new to this CMS. I want to make a navigation list that will display the names for the resources by their id. I’ve started it as a chunk, but I’m starting to think it should be a snippet and needs to query the database.

    So far I have:
    <li><a href="[[~1]]" id="homeLink">Home</a></li>

    Ideally I would replace home with a dynamic link to the name of resource 1. Is there a tag for this, or do I need to use a snippet?
      • 21262
      • 1 Posts
      http://rtfm.modx.com/display/ADDON/Wayfinder

      Probably want to look into wayfinder for setting up the navigation. I’m sure what you’re looking to do is possible but I would imagine having a dynamic navigation overall will just make your life easier in the long run.
        • 29701
        • 0 Posts
        Cool, thanks. That looks like exactly what I want.
          • 33968
          • 863 Posts
          getResources is another useful one for listing other resources (though Wayfinder is the way to go for navigation).

          And you can use getResourceField to grab a particular field from any other resource.