Asign a cms selflink to an image

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
pandaman

Asign a cms selflink to an image

Post by pandaman »

Hi
Can anyone tell me how to assign a cms selflink  to an image please ?
alby

Re: Asign a cms selflink to an image

Post 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
pandaman

Re: Asign a cms selflink to an image

Post by pandaman »

Thank you
What is the code to resize the image within this tag ?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Asign a cms selflink to an image

Post by calguy1000 »

The other way is : 
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Franck
Dev Team Member
Dev Team Member
Posts: 261
Joined: Tue Jun 12, 2007 1:29 pm

Re: Asign a cms selflink to an image

Post 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 :
Image
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
Last edited by Franck on Mon Sep 15, 2008 4:50 pm, edited 1 time in total.
Simon66
Power Poster
Power Poster
Posts: 250
Joined: Wed Aug 29, 2007 4:36 am

[SOLVED] Asign a cms selflink to an image

Post 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
Last edited by Simon66 on Sun Jun 21, 2009 10:29 pm, edited 1 time in total.
A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.

This must be Thursday. I never could get the hang of Thursdays.

Douglas Adams - The only sane person in the asylum.
alby

Re: Asign a cms selflink to an image

Post by alby »

Simon66 wrote: Anybody got a fix for this?
Is missing a quote
Alby
Simon66
Power Poster
Power Poster
Posts: 250
Joined: Wed Aug 29, 2007 4:36 am

Re: Asign a cms selflink to an image

Post by Simon66 »

Alby
I tried it with the missing quote mark


and got the same results:


Simon
A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.

This must be Thursday. I never could get the hang of Thursdays.

Douglas Adams - The only sane person in the asylum.
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm

Re: Asign a cms selflink to an image

Post 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>
Simon66
Power Poster
Power Poster
Posts: 250
Joined: Wed Aug 29, 2007 4:36 am

Re: Asign a cms selflink to an image

Post by Simon66 »

Thanks!
Works perfectly.

Simon
A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.

This must be Thursday. I never could get the hang of Thursdays.

Douglas Adams - The only sane person in the asylum.
Locked

Return to “CMSMS Core”