Tag a before tag img

Permalink
I have a problem: I want that the my client could inset in the main block a image and the cms write:
<a href="link of the image" rel="a word set"><img src="link of the image"/></a>

I need this to create a lightbox... in the theme.
It is possible?
Maybe with php?

An alternative would be if I could (with php) have the url of the image ...

Thank you

Fxxxx
 
jordanlev replied on at Permalink Reply
jordanlev
Have you seen the "Zoom Image Dual" addon?
http://www.concrete5.org/marketplace/addons/zoom-image-dual...

If you want to create these for yourself instead, I believe Designer Content would be ideal for this situation:
http://www.concrete5.org/marketplace/addons/designer-content...

For the lightbox, you'll need to put the lightbox javascript in your page type template. The difficulty is going to be putting that "rel" tag on the <a> link. Is that essential to your lightbox code?
Fxxxx replied on at Permalink Reply
Fxxxx
OK but I wanted to install Facybox on my theme...
jordanlev replied on at Permalink Reply
jordanlev
OK. What exactly is the problem or question about that?
Fxxxx replied on at Permalink Reply
Fxxxx
Fancybox needs tris code
<a href="link of the image" rel="a word set"><img src="link of the image"/></a>

for every image... Look at the site of fancybox...

So when my client inserts the image intorno the page I need a link to the image before the tag of the image...
OK?
Thank you!
jordanlev replied on at Permalink Reply
jordanlev
Did you look at the "Zoom Image Dual" addon in the marketplace? It's free, and it sounds like it does exactly what you want it to do.
Fxxxx replied on at Permalink Reply
Fxxxx
Ok but I am building a theme and I am trying to imstall fancybox in the theme without any add-on... Like the SLATE theme...
jordanlev replied on at Permalink Reply
jordanlev
I don't think you can do this without an addon, unless you make a custom template for the content block that rewrites html before it's outputted -- but that's a rather advanced and error-prone technique (and doesn't give your users the options that a block would give them, such as being able to set the image sizes or the lightbox animation effect settings).

There's nothing wrong with including a block in your theme package -- many themes do this.
Fxxxx replied on at Permalink Reply
Fxxxx
But with php code can I get the url of the image that the user inserts into the page?
jordanlev replied on at Permalink Reply
jordanlev
Anything's possible, it's just a question of how much technical skill you have and/or how much time and effort you want to put into learning it, implementing it, testing it, fixing bugs, etc. Google around for "php html parsing" if you're interested.
Fxxxx replied on at Permalink Best Answer Reply
Fxxxx
OK I have found it!
I will use Jquery