[SOLVED] No image for {anchor} tag

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.
Post Reply
eh
Forum Members
Forum Members
Posts: 29
Joined: Sun Oct 07, 2007 1:19 pm

[SOLVED] No image for {anchor} tag

Post by eh »

As compared to the {cms_selflink} tag the {anchor} tag has no attribute to provide an image to display in a page instead of text.

Any idea how to easily extend (or misuse) this tag so it can also be used with an image?

Thanks!
Ernst
Last edited by eh on Wed Apr 08, 2009 2:12 pm, edited 1 time in total.
Kellergeier
New Member
New Member
Posts: 6
Joined: Sat Mar 07, 2009 1:07 pm

Re: No image for {anchor} tag

Post by Kellergeier »

Hello Ernst,

I encountered the same problem. I solved it with the onlyhref parameter.

Code: Select all


<a href="{anchor anchor="pagetop" onlyhref="1"}">
   <img src="arrow.gif" alt="Page Up" width="16" height="16" />
</a>

Hope it works for you!
Last edited by Kellergeier on Sat Mar 07, 2009 1:18 pm, edited 1 time in total.
eh
Forum Members
Forum Members
Posts: 29
Joined: Sun Oct 07, 2007 1:19 pm

Re: No image for {anchor} tag

Post by eh »

Hello Kellergeier
I'll try it out.
Thanks for your reply anyway!
Ernst
faglork

Re: No image for {anchor} tag

Post by faglork »

eh wrote: As compared to the {cms_selflink} tag the {anchor} tag has no attribute to provide an image to display in a page instead of text.

Any idea how to easily extend (or misuse) this tag so it can also be used with an image?
There is an even simpler way. Since you can reference CSS IDs as well, you just add an ID to the image. This is an option in TinyMCE's "insert/change image" dialogue.

hth,
Alex
eh
Forum Members
Forum Members
Posts: 29
Joined: Sun Oct 07, 2007 1:19 pm

Re: [SOLVED] No image for {anchor} tag

Post by eh »

Didn't know that one can reference ID's as the target of a href . This implies that {cms_selflink} will resolve a reference to an ID correctly even the ID might be on another page? Have to try this out.
Thanks for the hint.
Ernst
eh
Forum Members
Forum Members
Posts: 29
Joined: Sun Oct 07, 2007 1:19 pm

Re: [SOLVED] No image for {anchor} tag

Post by eh »

Using an ID as the anchor works fine. Great!
Tested with Firefox, IE7, Opera and Safari (on windows).
Thanks again.
Ernst

My test page:

Code: Select all

<p><img id="demoanchor" src="uploads/images/logo1.gif" alt="" width="198" height="52" /></p>
<p> </p>
<p> </p>
...
...
...
<p> </p>
<p> </p>
<p> </p>
<p>{cms_selflink dir="anchor" anchorlink="demoanchor" text="Click here..."}</p>
Post Reply

Return to “CMSMS Core”