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

    I have a getResources call which has a couple of Weblinks in the output. The client wants those to oppen in a new browser window. I added [[+link_attributes]] to my tpl as below:
    <li>
    <a href="[[~[[+id]]]]" [[+link_attributes]] title="[[+pagetitle]]">
    <p>[[+pagetitle]]</p>
    </a>
    </li>

    and in the link attributes field on the resource, I have target="_blank"

    But it's not working - any ideas? I've used this with wayfinder before, but thought it should work with getResources too?


    Thanks
    Andy
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Try the pdoTools package, and its pdoResources snippet. I haven't used getResources for years.
      <li><a href="[[~[[+id]]]]" [[+link_attributes]]>[[+menutitle]]</a></li>
        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
        • 51020
        • 670 Posts
        Quote from: sottwell at Apr 26, 2016, 06:16 AM
        Try the pdoTools package, and its pdoResources snippet. I haven't used getResources for years.
        <li><a href="[[~[[+id]]]]" [[+link_attributes]]="">[[+menutitle]]</a></li>

        Ok - so do you use pdo to replace wayfinder too?
          • 10208 ☆ A M B ☆
          • 1,780 Posts
          To replace Wayfinder, use pdoMenu. It comes with pdoTools. A few things are different though. See the documentation. The one thing I have noted as not working the same is the &textOfLinks parameter. I've had to use a placeholder such as [[+menutitle]] or [[+pagetitle]] in the tpl instead of [[+wf.linktext]] if I want it to show anything but the pagetitle.
            Frogabog- MODX Websites in Portland Oregon
            "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
            Having server issues? These guys have MODX Hosting perfected - SkyToaster