We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16085
    • 203 Posts
    I have some static links that I use in a chunk but I’m finding I might forget to up date there title or alt tags for whatever reason.

    So I created a Weblink set the appropriate pagetitle, longtitle, description and weblink. Then in my chunk I replace the href= with docId [~57~] (weblink) and title= with [[getField? &docid=`57` &field=`longtitle`]]. Now the link displays as it should but it references as domain.com/link and when I click it I’m taken to the docId page.

    What I thought would happen was the link would open/forward a new tab/window to the URL rather then the docId page!

    Anyone else used this method or got it working?
      • 16085
      • 203 Posts
      Figured it out. Just used an empty template with [*content*] and set the Weblink to use that template.

      However would this not affect the search engines because it feels like bit of a spammy re-direct type thing rather then a straight through link?
        • 27708 MODX Staff
        • 2,502 Posts
        I am not quite sure why you wouldn’t use Wayfinder for this. In blogs for link lists I create a parent (container) like "Blogroll" and then place my weblink resources in there. I then use Wayfinder to display them. It works fine and you get the same result (unless I misunderstand your problem).

        Cheers,

        Jay
          Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
          • 7231
          • 4,205 Posts
          Menus get smarter

          Then the authors of the Wayfinder snippet got tired of this redirect business, which meant that the link displayed for the page in the menu was the address of the weblink document, not where you wanted to go! For example, if you had a weblink to google.com, the link displayed would be to the weblink document, which could be "index.php?id=543", or "go-to-google.html", instead of google.com. So they modified Wayfinder to check if the document it was addding to the menu was a "reference", and if it was, to use the document’s content to make the link. This had two advantages, it not only caused the proper URL to be displayed (in tooltips or the status bar of the browser), it also eliminated the redirect, and an extra call to the parser with an accompanying extra query to the database.

          From http://sottwell.com/article-weblinks.html

          In Ditto you need to do this manually by using the +content+ filed for the link rather than the +id+.
            [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't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 16085
            • 203 Posts
            @jay, thanks for your reply.

            Something funky was going on with my localhost install. Just tried it on my default modx install and the Weblink worked.

            @dev_cw, Wayfinder. doh! forgot about that. smiley
              • 16085
              • 203 Posts
              Wayfinder works perfectly. Can’t believe I missed that!

              Kept is simple used the &include to grab my link. [!Wayfinder? &startId=`0` &textOfLinks=`longtitle` &includeDocs=`17`!]
                • 16085
                • 203 Posts
                Has anyone tried this with images. So basically wf will output the Weblinks with appropriate image. ..thinking about it I could use a TV to set the image with classname already set in the CSS for a wf to output into a template chunk. Kind of like a text-indent:-9999 type trick.

                but if anyone has done it already!? smiley

                okay this post I think is where I’m going with it: Wayfinder image tv’s

                >> just to rap up my own question. Used a TV for the image, &rowTpl= in my wf call and for the rowTPL chunk used: <li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]"><img src="[+linkImage+]" alt="[+wf.longtitle+]></a></li>

                update. didn’t check with images off, but for some reason the alt attrib didn’t work and title tag not showing up. Using FF v3.0.6 btw.

                update update. My eyes are glazing over. rolleyes So simple; the &rowTPL should be: <li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]"><img src="[+linkImage+]" alt="[+wf.linktext+]" border="0"></a></li>