We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10189
    • 109 Posts
    I’m looking to make a TV that will allow my user to see a resource’s full URL (including domain) inside the Manager, while editing the document. Before I start working on this, is this even possible? I realise that the resource has to be saved first in order for the alias to be generated.

    The reason for this TV is that my user will create documents that will not be in any menues and effectively hidden from plain view (yet still be published). They’ll be using this for landing pages and need to paste the URL for newsletters.

    Help is, as always, very much appreciated!
      • 3749
      • 24,544 Posts
      An easier (and maybe better) approach would be to have the users enter MODx link tags where they want the URLS:

      [~nn~]


      Where nn is the document ID of the document you want a URL for. MODx will generate the URL for you and it will work regardless of FURL settings or the location of the site.

      Hard-coding URLs means the site can’t be easily moved or duplicated on a local machine for testing and upgrading and may break if the FURL setting is changed or a document is renamed.
        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
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        If they’re using a MODx document for the newsletter, they don’t need to do that. The regular TinyMCE "Insert Link" button will open a popup window; the second field has an icon to its right that will allow choosing a (published) document to link to; the MODx tags for the document will be inserted. When using the document for a newsletter, it will get parsed and the URL generated from the tags as usual.
          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
          • 10189
          • 109 Posts
          Thanks for such speedy replies. smiley

          Well, the newsletter is outside of MODx so I’m not sure this would work out. But if I understand you correct, sottwell, I’m to have my user insert the tags in the document and the let MODx parse it and then copy the full URL from the front, correct?
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Can’t your newsletter application use a given URL for its newsletter? That’s what I do for the DADA mail perl application that I favor; the user creates his newsletter as a MODx document. I have the DADA template set up to use a specific page as its newsletter, and the user just edits the old one (or if he wants to keep them for archive purposes, duplicates it and makes sure to put in the correct alias in the new one as he edits it).
              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
              • 10189
              • 109 Posts
              I suppose my user could just figure out the URL based on the aliases creating the path. I just hoped that I could make it a bit easier for them by providing a generated string from within the manager that they could copy and paste. smiley