link open in blank page

Author Message

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 01:17:23
Script start
Timing: Jan 19 2025 01:17:23
Module start 'layout'
Timing: Jan 19 2025 01:17:23
Module start 'content'
Timing: Jan 19 2025 01:17:24
Module end 'content'
Timing: Jan 19 2025 01:17:24
Script end

Main resources:

Total runtime0.7455 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 590.2813152.6250
Module start 'layout' 0.00650.0045 742.906339.4453
Module start 'content' 0.01110.7330 782.3516527.2969
Module end 'content' 0.74410.0014 1,309.648412.1719
Script end 0.7454  1,321.8203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4593160.0002
Check MTime0.00140.1917160.0001
Mysql Total
Database connection0.00080.111910.0008
Mysqli_queries0.698693.7107540.0129
Looping result0.00040.0595520.0000
Template Total0.711295.420.3556
Template load0.00190.261120.0010
Template processing0.709295.135920.3546
Template load and register function0.00020.026410.0002
states
state_id_array0.00120.165910.0012
state_identifier_array0.00070.091920.0003
Override
Cache load0.00160.2147300.0001
Sytem overhead
Fetch class attribute can translate value0.00050.069020.0003
Fetch class attribute name0.00110.149630.0004
XML
Image XML parsing0.00050.071120.0003
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00080.1049170.0000
String conversion0.00000.001940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs