Image block -> open in new window
Permalink 1 user found helpful
Is it possible to add an external url target (_blank) to an image with the image block? Or should I use a html block?
Use the content block, and add image. Than click on the image, and press the link button. Add your external url, and set target open in new window. To resize the image just adjust the transform box that appears when it is clicked. Screengrab atached just in case.
Thanks Ekko! I'm creating my first site with concrete5, I like it a lot.
I'd like to use the image block for this, because TinyMCE wraps a paragraph around the image.
I've copied the class from the core to my root and changed the almost last line:
But how can I make something like
?
I've copied the class from the core to my root and changed the almost last line:
$img = "<a href=\"{$linkURL}\" target=\"_blank\">" . $img ."</a>";
But how can I make something like
if($linkURL == external){ echo ' target="_blank"'; }
?
Did you know you can stop TinyMCE from doing that in its config file? NB. it would apply to all content blocks.
I am also looking for a way to do it with the image block ... did you figure it out? I'll post here if I find a solution.
I am also looking for a way to do it with the image block ... did you figure it out? I'll post here if I find a solution.
I found a solution by creating a new, modified Image block ... let me know if you are still looking to resolve this.
I'd love to! ;-)
OK - just bear in mind that this quick and dirty solution I made does not have a nice dropdown menu to choose from or anything like that ... just adds target="_blank" to the <a> tag. I will make a more elegant solution when I get a little time but it does work :)
I attach the modified block ... do you know how to add it to Block types?
EDIT
Better solutions below
I attach the modified block ... do you know how to add it to Block types?
EDIT
Better solutions below
And did you want to know how to stop the added <p></p> in TinyMCE?
I just had a look the Add-ons section (should have done this first!) and there is a free add-on called Image Blank Target which does exactly what is needed:
http://www.concrete5.org/marketplace/addons/image-blank-target/...
It is a much more elegant solution :)
http://www.concrete5.org/marketplace/addons/image-blank-target/...
It is a much more elegant solution :)
These are much more versatile:
http://www.concrete5.org/marketplace/addons/fancy-image-links/...
http://www.concrete5.org/marketplace/addons/fancybox-links/...
or for a simple lightbox
http://www.concrete5.org/marketplace/addons/lightboxed-image/...
http://www.concrete5.org/marketplace/addons/fancy-image-links/...
http://www.concrete5.org/marketplace/addons/fancybox-links/...
or for a simple lightbox
http://www.concrete5.org/marketplace/addons/lightboxed-image/...
Hmmm ... that first one looks tasty - thanks!
Thanks for replying!
This really should be integrated into the core!
For sure
Thanks to your message i found the solution !
Thank you ! Just what i needed !
Thank you ! Just what i needed !