Image Block - External Link
Permalink
Hi,
I'm using the Image Block to utlisize the Image on State function and have linked the image to an external file but I want to have it opening in a new browser window. How can I add the target="_blank" to this?
THanks.
I'm using the Image Block to utlisize the Image on State function and have linked the image to an external file but I want to have it opening in a new browser window. How can I add the target="_blank" to this?
THanks.
Thanks Enlil,
I downloaded the file into my directory, but the controller.php doesn't have any code it it, just this:
<?php
defined('C5_EXECUTE') or die("Access Denied.");
class ImageBlockController extends Concrete5_Controller_Block_Image {
}
Any other ideas?
Annette
I downloaded the file into my directory, but the controller.php doesn't have any code it it, just this:
<?php
defined('C5_EXECUTE') or die("Access Denied.");
class ImageBlockController extends Concrete5_Controller_Block_Image {
}
Any other ideas?
Annette
You can also create a template file in /blocks/image/templates/link_blank.php or in /blocks/image/view.php
with the following contents:
<?php
defined('C5_EXECUTE') or die("Access Denied.");
echo str_replace('<a href', '<a target="_blank" href', $controller->getContentAndGenerate());
with the following contents:
<?php
defined('C5_EXECUTE') or die("Access Denied.");
echo str_replace('<a href', '<a target="_blank" href', $controller->getContentAndGenerate());
Thanks akodde, that worked!
Kind regards...Annette
Kind regards...Annette
$img = "<a href=\"{$linkURL}\">" . $img ."</a>";
change it to:
$img = "<a target="_blank" href=\"{$linkURL}\">" . $img ."</a>";