We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34193
    • 330 Posts
    Hi I want to be able to append the same URL variable and value automatically to every link for internal pages I may be missing away of doing this but I spent hours trying to figure it out and can’t.
      • 1778
      • 659 Posts
      Not sure if this helps but if you want your URL like this

      Your URL
      <a href="mypage.html?myvar=myvalue">text of link</a>
      


      I think you can do something like

      <a href="[[~5]]?[[$myvariable]]">text of link</a>
      


      where 5 is the ID of the target resource

      [[$mavariable]] is a chunk with just

      CHUNK MYVARIABLE :
      myvar=myvalue
      


      Not sure if it’s your goal, but hope this helps
      Cheers
        • 34193
        • 330 Posts
        Yea but the fact is I need every page to have it appended automatically, I may have not made it clear i need revo to add the url variable as the link is created, no matter how the link is created either a manually created one and via wayfinder or any other way.

        So inserting [[~5]] will display the url with the variable, and it will be added within in wayfinder or anywhere else.

        I.E in the same way that .html is added to pages I need it to add somthing like .html?variable=test.

        I suppose I could write a javascript to do this.


          • 1778
          • 659 Posts
          Not sure at all but maybe it’s possible with a Plugin and System Events like OnBeforeDocSave or something like that...
          Try to have a look at http://svn.modxcms.com/docs/display/revolution/System+Events

          Cheers