Page 1 of 1
Asign a cms selflink to an image
Posted: Sun Sep 16, 2007 10:07 am
by pandaman
Hi
Can anyone tell me how to assign a cms selflink to an image please ?
Re: Asign a cms selflink to an image
Posted: Sun Sep 16, 2007 10:15 am
by alby
pandaman wrote:
Can anyone tell me how to assign a cms selflink to an image please ?
Extensions > Tags
Help of cms_selflink:
# (optional) image - A url of an image to use in the link. Example: {cms_selflink dir="next" image="next.png" text="Next"}
# (optional) alt - Alternative text to be used with image (alt="" will be used if no alt parameter is given).
# (optional) imageonly - If using an image, whether to suppress display of text links. If you want no text in the link at all, also set lang=0 to suppress the label. Example: {cms_selflink dir="next" image="next.png" text="Next" imageonly=1}
Alby
Re: Asign a cms selflink to an image
Posted: Sun Sep 16, 2007 10:36 am
by pandaman
Thank you
What is the code to resize the image within this tag ?
Re: Asign a cms selflink to an image
Posted: Sun Sep 16, 2007 2:29 pm
by calguy1000
The other way is :
Re: Asign a cms selflink to an image
Posted: Thu Oct 11, 2007 3:03 pm
by Franck
want to assign a cms selflink to an image, using a nice css-driven rollover effect ?
Thanx to the last reply by calguy2000, I found out the one missing thing I was needing.
So how to do it ?
the xhtml part :
Code: Select all
<a href="{cms_selflink href="name-of-the-page"}" title="title-you-want" id="imagelink"></a>
you don't need to put the image link here, it's defined in the css.
this is the css part :
Code: Select all
a#imagelink {
background: transparent url(images/nameoftheimg.jpg) no-repeat 0 -65px;
display: block;
height: 65px;
width: 65px;
}
a:hover#imagelink {
background: transparent url(images/nameoftheimg.jpg) no-repeat 0 0;
}
To avoid too much loading time when rollover, there's only one image with two parts, positioned to be viewed at the normal state and at the rollover one.
example :

top of the image is used when rollover.
More info :
original technique from
http://wellstyled.com/css-nopreload-rollovers.html, french tuto :
http://css.alsacreations.com/Tutoriels-et-articles-divers/roll-over-css-image-unique
[SOLVED] Asign a cms selflink to an image
Posted: Sat Jun 20, 2009 4:26 am
by Simon66
When I try Calguys method:
using TinyMCE in a global content block, it breaks the link.
When I re-open the HTML window it has turned the href to this:
Anybody got a fix for this?
Thanks
Simon66
Re: Asign a cms selflink to an image
Posted: Sat Jun 20, 2009 7:46 am
by alby
Simon66 wrote:
Anybody got a fix for this?
Is missing a quote
Alby
Re: Asign a cms selflink to an image
Posted: Sun Jun 21, 2009 2:27 am
by Simon66
Alby
I tried it with the missing quote mark
and got the same results:
Simon
Re: Asign a cms selflink to an image
Posted: Sun Jun 21, 2009 3:01 am
by Jeff
Simon66 wrote:
Alby
I tried it with the missing quote mark
and got the same results:
Simon
You can't use quotes inside quotes. Try:
Code: Select all
<a href="{cms_selflink href='somepage'}"><img src="uploads/myimage.jpg" width="100"/></a>
Re: Asign a cms selflink to an image
Posted: Sun Jun 21, 2009 4:47 am
by Simon66
Thanks!
Works perfectly.
Simon