Open xml link in new window

The banner in the demo is set to open to another page within the site.

I have changed the banner to the Twitter logo and i want the link to open in a new window.

As this link is contained with the catalog.xml is the snytax still the same as if it were html ?

ie ‘blank’

thanks

9 answers

Profile photo of thangnn1510 0.00 $tone May 26, 2011
Public

The html code of the banner is in .phtml files in app\design\frontend\base\defaulttemplate\callouts :

You should copy them to app\design\frontend\default\jm_oganistemplate\cal louts and change

Code:

<div class="block block-banner">
    <div class="block-content">
        <?php if(strtolower(substr($this->getLinkUrl(),0,4))==='http'): ?>
            <a href="<?php echo $this->getLinkUrl() ?>" title="<?php echo $this->__($this->getImgAlt()) ?>">
        <?php elseif($this->getLinkUrl()): ?>
            <a href="<?php echo $this->getUrl($this->getLinkUrl()) ?>" title="<?php echo $this->__($this->getImgAlt()) ?>">
        <?php endif; ?>
            <img src="<?php echo $this->getSkinUrl($this->getImgSrc()) ?>"<?php if(!$this->getLinkUrl()): ?> title="<?php echo $this->__($this->getImgAlt()) ?>"<?php endif; ?> alt="<?php echo $this->__($this->getImgAlt()) ?>" />
        <?php if($this->getLinkUrl()): ?>
        </a>
        <?php endif ?>
    </div>
</div>
#1
Profile photo of thangnn1510 0.00 $tone June 21, 2011
Public

hi, sorry i didnt follow this.

it says change code but i dont know which code or what to change it to.

thanks

If you want to change link please simply change to:

Code:

<div class="block block-banner">
    <div class="block-content">
        <?php if(strtolower(substr($this->getLinkUrl(),0,4))==='http'): ?>
            <a href="<?php echo $this->getLinkUrl() ?>" title="<?php echo $this->__($this->getImgAlt()) ?>" target="_blank">
        <?php elseif($this->getLinkUrl()): ?>
            <a href="<?php echo $this->getUrl($this->getLinkUrl()) ?>" title="<?php echo $this->__($this->getImgAlt()) ?>">
        <?php endif; ?>
            <img src="<?php echo $this->getSkinUrl($this->getImgSrc()) ?>"<?php if(!$this->getLinkUrl()): ?> title="<?php echo $this->__($this->getImgAlt()) ?>"<?php endif; ?> alt="<?php echo $this->__($this->getImgAlt()) ?>" />
        <?php if($this->getLinkUrl()): ?>
        </a>
        <?php endif ?>
    </div>
</div>

target="_blank" has been added.

#3
Profile photo of thangnn1510 0.00 $tone June 28, 2011
Public

I have given solution but maybe you couldn’t follow it. I have fixed it in your site. Please change in right_col.phtml to:

Code:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to [email protected] so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<div class="block block-banner">
    <div class="block-content">
        <?php if(strtolower(substr($this->getLinkUrl(),0,4))==='http'): ?>
            <a target="_blank" href="<?php echo $this->getLinkUrl() ?>" title="<?php echo $this->__($this->getImgAlt()) ?>">
        <?php elseif($this->getLinkUrl()): ?>
            <a target="_blank" href="<?php echo $this->getUrl($this->getLinkUrl()) ?>" title="<?php echo $this->__($this->getImgAlt()) ?>">
        <?php endif; ?>
            <img src="<?php echo $this->getSkinUrl($this->getImgSrc()) ?>"<?php if(!$this->getLinkUrl()): ?> title="<?php echo $this->__($this->getImgAlt()) ?>"<?php endif; ?> alt="<?php echo $this->__($this->getImgAlt()) ?>" />
        <?php if($this->getLinkUrl()): ?>
        </a>
        <?php endif ?>
    </div>
</div>

. Thanks.

#7
Profile photo of cameron ferris 0.00 $tone June 28, 2011
Public

Sorry i couldnt figure it out, but im very grateful as always for your help.

As time has gone by ive come to realise how crucial the support is of JOOMLART.

THANK YOU

#8

Please login or Register to Submit Answer

Written By

Comments