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

    I am new to working with ModX. I am deploying new template files to ModX and for some reason, all of the hyperlinks to other sites are being malformed by ModX. I know that ModX has capabilities to setup resources to be viewed as web links....however, this is really alot of overkill on me just needing to place a generic link in a template.

    What setting can I configure where my "href" attributes are ignored. I know it is possible because I am seeing it in other ModX sites.

    Please help. This is a silly thing to get stuck on.
      • 41265
      • 6 Posts
      FYI - I am needing the correct absolute URL in my hyperlinks. Modx changes these URLs and adds the base url, in addition to other stuff. I understand this need for other pages in the modx site...but not when I am trying to link to something different entirely.
        • 39932
        • 483 Posts
        One option is to go to System Settings. Search for 'link_tag_scheme' and change it to abs. This will make all [ [~#] ] links absolute for you. This does not affect makeUrl() in a Snippet but resolves general MODx linkage when you need an absolute link.

        For Snippets that use Chunks (templatizing), you can add a prepending slash to the link. (i.e. href="/[ [~[ {+id] ] ] ]). Some extras use default MODx behavior and some don't, so you may have to modify Chunks accordingly.
          Website: Extended Dialog Development Blog: on Extended Dialog
          Add-ons: AJAX Revolution, RO.IDEs Editor & Framework (in works) Utilities: Plugin Compatibility List
          Tutorials: Create Cross-Context Resources, Cross-Context AJAX Login, Template-Based Actions, Remove Extensions from URLs

          Failure is just another word for saying you didn't want to try. "It can't be done" means "I don't know how".
          • 41265
          • 6 Posts
          Thanks for the reply, Fuzzical. Those options did not help, however. I apparently don't have the ability to go to the system settings. I am using "chunks" so I did try the other option...however, it didn't help.

          This version of ModX is Evolution 1.0.6. Any other ideas?
            • 39932
            • 483 Posts
            I apologize, the options I gave were for Revo. I'm not familiar with Evo.
              Website: Extended Dialog Development Blog: on Extended Dialog
              Add-ons: AJAX Revolution, RO.IDEs Editor & Framework (in works) Utilities: Plugin Compatibility List
              Tutorials: Create Cross-Context Resources, Cross-Context AJAX Login, Template-Based Actions, Remove Extensions from URLs

              Failure is just another word for saying you didn't want to try. "It can't be done" means "I don't know how".
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              If you put a link in a template, you have to put the whole thing:

              <a href="http://www.site.com">Link</a>


                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
                • 41265
                • 6 Posts
                Hi Susan,

                Thanks for the response. However, embedding a link inside of another link is not doing anything except causing syntax errors.

                Honestly, my big issue is to stop the ModX Evo instance from adding the site url. I do not have the site url set anywhere in the chunk or template...however, the base site url is still being added. In the hyperlink syntax, I only have a url setup like "<a href="http://www.google.com">Test</a>. However, when I refresh the site and review the link, it looks like "http://www.mysite.com/http:www.google.com.php"

                How do I force Evolution to stop adding the above base url so I can ONLY use the absolute url I have set in place?

                Thanks,

                John
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Hm. That is not at all what I entered, and when I edit the post it shows just ordinary a tags. I'm sorry, it should not look like that at all. The forum text input processor apparently thought it needed to try to make a proper URL out of just code. What I meant was to have

                  As far as your issue, it's odd, but I've never run across that unless I've forgotten to put the protocol (the http:// part) in the href attributed. What plugins do you have installed? What does your base tag in the template head output?

                  (I'll report the rendering bug in the forum editing field). [ed. note: sottwell last edited this post 14 years, 1 month ago.]
                    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
                    • 41265
                    • 6 Posts
                    Thanks Susan. I actually have ensured that the host/base urls were removed from the head.The URLs in the HTML syntax are also specified with the "http" correctly.

                    This really is mind boggling. I have never had an instance of any CMS system automatically changing a hard-coded URL setup in a link...very frustrating actually.
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Well, I have to say that I've never heard of this happening in MODx either. That's why I asked what plugins you have installed.
                        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