We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10405
    • 288 Posts
    Hi,

    I am running MODX version 2.1.3 and there seems to be a problem with displaying hyperlinks in a template variable. I basically have a box in a right column that I have set as a template variable and I want to display text and hyperlinks in it but for some reason the links only work on one page and not in others. I have tried using separate template variables with different links for each page but the links are not clickable and just display as plain text.

    The template variable has a unique name, the input is set to richtext, output is default and the access has been given to the appropriate page so I can't see why it's not working. Any ideas would be much appreciated.

    Thanks.

      • 9102 ☆ A M B ☆
      • 318 Posts
      Hmmm... what do you mean by "only work on one page and not in others?" Do you mean that the links have the wrong href on some pages? In that case, are you using friendly URLs and URL paths? Are the links absolute or relative? Do you have a correct base tag in your template?

      With the problem of not being clickable -- is the rich text editor changing the code somehow? Have you tried setting the TV to plain text? What does the output code look like, and how is it different on the pages that don't work vs. the pages that do?
        • 10405
        • 288 Posts
        The hyperlinks are relative links and I am using friendly URLs.

        The original page with the template variable displays the links as clickable hyperlinks but when the same template variable is used on another page it just displays as text not a hyperlink, even though the source code has the correct tags and href. I have tried setting up a completely new TV to use instead but the links still don't work (as in they are not clickable at all) so it doesn't appear to be as a result of using the same TV on multiple pages.

        Setting the TV to plain text rather than richtext doesn't seem to have any affect.

        It's a mystery!
          • 3749
          • 24,544 Posts
          If it's a richtext TV, TinyMCE might be "entifying" them for you (it's so helpful). Once they're saved, they will stay that way even if you change the type of the TV.

          Are you entering them as link tags?

          <a href="[[~12]]">Some Text</a>

            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting