We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts
    Is there a way to set the target in the weblink option?
    I know it is not valid xhtml but what if you need to open a extarnal link in a new window?

    in this case the wrapper does not work cause the page that opents checks if it is opent in a frame or not
    http://www.anwb.nl/azf/zoekresultaat.html?azfid=contact

    so that way the whole page disapears and get replaced bij this one.

    Greets Dimmy
      follow me on twitter: @dimmy01
      • 7455
      • 2,204 Posts
      In what file does this weblink get parsed?
      I will edit that one to add a non trickt target function.
      I realy need an option to open an outside site in a new frame.
      and that this link is a menuitem

        follow me on twitter: @dimmy01
        • 7455
        • 2,204 Posts
        LOL even this board is using target="_blank"hehe so not realy strikt xhtml1.0 try the link on the right (or this one http://validator.w3.org/check/referer)

        I hope that there wil be a good solution soon

        It looks like all members are on holiday, its so quiet here

        Greets Dimmy
          follow me on twitter: @dimmy01
          • 32963
          • 1,732 Posts
          Hi Dimmy,

          We’re all here but working on TP3 smiley

          This should not be very difficult to add. Do you have the an example showing how it shold be done in xhtml?

            xWisdom
            www.xwisdomhtml.com
            The fear of the Lord is the beginning of wisdom:
            MODx Co-Founder - Create and do more with less.
            • 7455
            • 2,204 Posts
            You would need to add javascript.
            Look here:
            http://www.sitepoint.com/article/standards-compliant-world

            maybe not that easy
              follow me on twitter: @dimmy01
              • 7455
              • 2,204 Posts
              Did this idea end up in TP3?
                follow me on twitter: @dimmy01
                • 32963
                • 1,732 Posts
                Sorry Dimmy it did not maye it into TP3.2 but it will in TP4
                  xWisdom
                  www.xwisdomhtml.com
                  The fear of the Lord is the beginning of wisdom:
                  MODx Co-Founder - Create and do more with less.
                  • 4018
                  • 1,131 Posts
                  What I basically did to get around this is use a template variable. I created a URL TV and used a hyperlink widget for the display of my link. Then I just pasted the following code into the Attributes field for the hyperlink widget:

                  onclick="window.open(this.href,'_blank');return false;"


                  You could probably substitute the ’_blank’ for another template variable if needed. That way you can select what the target will be. There’s probably a bunch of different ways to do this...but this is the way I did it for my own TV since I have no need to select my target...they all open up in a new window on my site.
                    Jeff Whitfield

                    "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
                    • 7455
                    • 2,204 Posts
                    so how do you use this tv in a weblink that is a menuitem (create new weblink) ?
                      follow me on twitter: @dimmy01
                      • 1764
                      • 680 Posts
                      I had a crazy thought. What if we got rid of weblinks and made them nothing more than regular documents. That’s really all they are now anyway, they just have one field that get’s flagged as to whether it’s a "document" or a link (I think they’re called references or something).

                      We could have a default template that would be a Hyperlink or somethig like that. There are a lot of ways that we could get the redirect to work, meta-refresh, javascript, php header() via snippet or plugin. But I’m thinking that most of the time it wouldn’t matter. Ideally I think it would be best to have the menu figure out ahead of time whether or not it’s a hyperlink and just send you there directly instead of using a redirect, but since a lot of menus are third-party you’d have to have a backup redirect anyway.

                      Going with something like this would have a few advantages...
                      1. It shows the power and flexibility of templates and TVs and will hopefully get some people thinking outside the box as to what can be done
                      2. It would allow you to add TVs to a weblink (ie target)
                      3. It should simplify the core a bit by letting us handle all documents the same way
                      4. It would also make it much easier to do customizations like a return to site frame

                      What do you think? The idea probobly needs some refining but I think the concept of not hard-coding weblinks has merit.