We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33453
    • 141 Posts
    Dumb question -

    What is a weblink and what would I use it for?
      • 2762
      • 1,198 Posts
      Weblinks are links to internal or external documents.
      You can create a useful link directory, simply using Newslisting snippet and an appropriate chunk to open links in _blank target.
        Free MODx Graphic resources and Templates www.tattoocms.it
        -----------------------------------------------------

        MODx IT  www.modx.it
        -----------------------------------------------------

        bubuna.com - Web & Multimedia Design
        • 33453
        • 141 Posts
        Thanks Banzai, but why would you use them instead of just plain <a></a> tags?
          • 32241
          • 1,495 Posts
          Hi,

          I never use weblink before, but as far as I could understand, the benefit of using weblink, you can control the address of the link with your own domain address.

          If the external file/site can be access using domain234.com/filename.html, but then your site being hosted on domain.com. Now it does make sense if you want your user to see the external file/site as domain.com/filename.html, which can be achieved using weblink I believe.

          Regards,
            Wendy Novianto
            [font=Verdana]PT DJAMOER Technology Media
            [font=Verdana]Xituz Media
          • Well, there could be many uses for WebLinks; for one, you use it as you would a symbolic link on a filesystem; it can point you to any other external or internal URL. In addition, these could be used to create a set of components to manage a set of external web links, or used as centralized repositories of re-usable links to use the internal link tags on (e.g. [~44~]), or even use them to create a set of autolinks that get replaced into content dynamically when certain words or phrases are encountered. I’ll have an example in just a bit of a LinkCategory module that lists all the links in a directory, allows you to expose the external URLs or use the link aliases, and is customizable with chunk templates.
              • 7455
              • 2,204 Posts
              Weblink is originaly made to have menubuilder render them into to your menu.

              there is not realy another way to add an external or internal link directly into the menu other than using snippets to redirect you from a page to an external link.

              e.g. If you have a shop online and you would like a direct link to you shop from the menu made by MODx than you would use this funktion.

              if you want a link on your page you just use the <a tag (or the globe icon in FCKEditor)

              One thing that does not work (yet) is using place holders in a weblink made from the menu option "New weblink" MODx does not pars those "pages" so using [~1~] or [[SnippetName]] as weblink input will not work.
              Would give lost of nice options if it would like random link button on your page or easy way of using 1page more then once in a menu etc.

              I hope its clear for you this way,

              Greets Dimmy
                follow me on twitter: @dimmy01
              • Easily fixed. Line 1046 of document.parser.class.inc.php:

                // check whether it's a reference
                if($this->documentObject['type']=="reference") {
                    // if it's an internal docid tag, process it
                    if(strpos($this->documentObject['content'],'[~') !== false) {
                        // generate a url
                        $this->documentObject['content'] = $this->rewriteUrls($this->documentObject['content']);
                    }
                    $this->sendRedirect($this->documentObject['content']);
                }
                  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