[Plone-UI] Re: Have portal_tab link to external URL and open it in new window

J Cameron Cooper jccooper at rice.edu
Mon Jun 25 17:33:14 UTC 2007


familyman wrote:
> Dear jcc
> 
> Sounds good, but how would I do that then? (Have no experience with js...).
> I've heard about the mark_special_links.js but I don't want it to change all
> my links (and I've tried it once and it doesn't work...).
> 
> Any ideas?

Something along the lines of::

   elt = document.getElementById('portaltab-whatever')
   elt.setAttribute('target', '_blank')

Not, by the way, that I encourage such a thing.

         --jcc

> J Cameron Cooper-8 wrote:
>> familyman wrote:
>>> Dear all,
>>>
>>> I'm trying to do this:
>>> I want a portal_tab (already set up in portal_actions, no problems there)
>>> to
>>> link to an external URL (no problem with string:http://www.website.dom)
>>> which works okay. Now I want to open the linked-to website in a new
>>> browser
>>> window. Can this be done in the portal_actions as well? Perhaps with an
>>> extended string command?
>>>
>>> Any ideas?
>>>
>>> Thanks for any comments/help. I've searched the forums but nobody seemed
>>> to
>>> have come up with anything...
>> No; that requires a different attribute, and one that actions do not 
>> generate. You could attach it with Javascript, since those links have 
>> nice ids on them. (I suppose there's the javascript: URL type, but 
>> that's ugly.)
>>
>> I do hate it when websites do that to me, though.
>>
>>                --jcc
>>
>> -- 
>> Connexions
>> http://cnx.org
>>
>> "Building Websites with Plone"
>> http://plonebook.packtpub.com



-- 
Connexions
http://cnx.org

"Building Websites with Plone"
http://plonebook.packtpub.com





More information about the UI mailing list