We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25046
    • 194 Posts
    I am trying to set a few links and anchors on a page. The idea is that there will be links at the top which lead to sections further down in the page. The problem is that when I click the links I get sent to my home page instead of to the anchor section. I am using TinyMCE to set the links and anchors but I must be doing something wrong. Here is an example of the HMTL code for the page:

    <ul>
    <li><a href="#north">North heading</a></li>
    </ul>
    <h2><a name="north"></a>North Heading</h2>

    With the above I would expect that clicking the link will jump me to the north section. But, again, it takes me to my home page instead.

    Any suggestions?
      • 25969
      • 118 Posts
      You can use the plugin AnchorsAway to correct anchor behaviour due to using <base>.
        • 25046
        • 194 Posts
        Thanks, that worked perfectly.
          • 7231
          • 4,205 Posts
          another work around is to do href="[~1~]#anchorName" where 1 is the id of the current document. Or you could use the [*id*] placeholder to make it generic href="[~[*id*]~]#anchorName"
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don&#39;t know what it is.
            Do you, Mr. Jones? - [bob dylan]