We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33479
    • 15 Posts
    Is there a placeholder for the URL Alias? I have searched and tired a few guesses without any luck (I am new to MODx).

    I want to load a header graphic for each page and thought the easiest way to do it would be to name it the same as the page URL alias and use a placeholder. Helps a little with SEO as well naming it that way. Is there be a better way to do this?

    Many Thanks
      Darren Burns
      Zero Gravity Web Works
      • 33968
      • 863 Posts
      If you’re using Evolution, try: [*alias*]

      For Revolution: [[*alias]]


      But if anyone changes the alias or page name then you could run into problems as the image filenames are hard coded.

      I would consider using an image template variable instead. You can then load a graphic for each page using the manager which will stay linked even if the url changes. The end user will be able to change it easily without needing a web developer too smiley

      Also, to keep it SEO friendly you can specify alt="[[*pagetitle]]" in your image tag which will give you a lot more value than the image filename.
        • 33479
        • 15 Posts
        Thanks Lucas. I had wondered about using a template variable but wasn’t quite sure how to implement it. Works a treat!
          Darren Burns
          Zero Gravity Web Works