Forums / Setup & design / link open in blank page
Matt Brady
Tuesday 10 October 2006 12:48:40 am
This maybe answered somewhere else in the forum but the search function is down at the mo....
How do I get the link class to open the url in a blank window? At the moment you can write the url in but can't seem to control where/how it opens.
------------------------------------------------------ SOLUTION ------------------------------------------------------ OK.. the easiest solution I found was to add another field (ie. target) to the link class with _blank as default (or _self if you want people to remain in the site by default). Create a new line.tpl override for the link class (line_link.tpl) and name it (I named mine target.tpl)Amend the default template... I just added target="{$node.data_map.target.content}" into it:
{section show=$node.data_map.location.has_content} <div class="attribute-link"> <p><a href="{$node.data_map.location.content}" target="{$node.data_map.target.content}">{section show=$node.data_map.location.data_text|count|gt( 0 )}{$node.data_map.location.data_text|wash}{section-else}{$node.data_map.location.content|wash}{/section}</a></p> </div> {/section}
and it works well. :)
It's not easy being easy.
Jacobo Quiles
Monday 06 November 2006 9:38:21 am
Hi!
You can always override the default link attribute template from ('design/standard/templates/content/datatype/view/ezurl.tpl') and add an extra parameter like this:
{default $target="_self"}
{section show=$attribute.data_text} <a href="{$attribute.content}" target={$target}>{$attribute.data_text|wash( xhtml )}</a> {section-else} <a href="{$attribute.content}" target={$target}>{$attribute.content|wash( xhtml )}</a>{/section}
{/default}
Then when u call the attribute and want it to open in new window do it like this:
{attribute_view_gui attribute=$node.data_map.location target="_blank"}
or
{attribute_view_gui attribute=$node.data_map.location}
to open in same window.
Cheers.
Microblau SL http://www.microblau.net