We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25018
    • 9 Posts
    When I create links in the TinyMCE editor, my links are always setup as relative to the current page.

    If I’m at:
    /path/page.html


    and I’ve like to link to:
    /mypage.html


    It always changes my paths to:
    /path/mypage.html


    Even when I use an a ’/’ before the address, it gets stripped when I save it.

    How can I fix this so when I type a / my urls are not changed?
    Thanks
    Rich
      • 22574
      • 181 Posts
      Hey Richtestani,

      Try going to tools, config, friendly url then turning off ’Use Friendly alias path:’

      Let me know how you go.
        • 25018
        • 9 Posts
        Well, that’s not really what I’m looking for.

        For one, I like the virtual paths, since it gives the site better looking urls, and doesn’t make the site seem flat.
        Also, this would not fix paths to image paths.
          • 7842
          • 8 Posts
          I have the same problem except that I’m trying to link to PDF files. With Friendly URLs enabled it should automatically prefix links to assets and resources with a slash to avoid problems. This is very common practice when using any sort of "pretty" URLs. But even when I try adding a slash into the HTML it gets stripped on save. This is incredibly annoying since it basically makes linking to assets impossible.

          Is there any way to disable the automatic stripping of the first "/"?

          Clairification: It seems that this is specifically a problem with TinyMCE. When I disabled TinyMCE and edited the HTML (instead of using the HTML button of TinyMCE) the "/" prefix was saved. So, is there a way I can modify TinyMCE to stop this?
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            There is a configuration option for the plugin itself. With the "Path Option" select box you can select one of three types of paths: rootrelative, docrelative, or fullpathurl.

            In the case of wanting the leading /, you would use "rootrelative".

            http://wiki.modxcms.com/index.php/TinyMCE#Plugin_Configuration
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 7842
              • 8 Posts
              And Susan beat me to it. Sorry for the double post. I didn’t think that someone would have replied so quickly. Had originally posted the solution Susan did. Thanks!