Using imagemap for a link to printpage-funkction

About the template and stylesheet - and changing the menu
Post Reply
mads
Posts: 22
Joined: Wed Jun 04, 2008 11:47 pm
Location: Århus Denmark
Contact:

Using imagemap for a link to printpage-funkction

Post by mads » Wed Jun 04, 2008 11:50 pm

Hi,

I'm working on a page where a like to put some of the "global tasks" into small icons in the top-graphich.
It works fine for the most of it, but not the printpage function.
You can see it here: http://www.bmail.dk/worlddance08
I have found a post in the old forum, that talks about (almost) same problem. See here
But there are at least three ways to implement the link:
1. The textlink used in most templates (called sa a <?php echo printlink();?>)
2. The URL with a post-extensioncode (calles as ?&print)
3. As a image linked in a "map" (called like this: <area href="?&sitemap" alt="Sitemap" shape="rect" coords="656, 8, 677, 28">

I want to use the number 3. but it works only for the sitemap (since there is only one sitemap)
When I use ?=print it will always call the frontpage and only the frontpage....

Anyone who have a suggestion for a work-around this?

Greetings,
:-) Mads

johnjdoe
Posts: 571
Joined: Tue May 20, 2008 6:32 am

Re: Using imagemap for a link to printpage-funkction

Post by johnjdoe » Thu Jun 05, 2008 6:49 am

I made a smalll function for myself that I included in functions.php:

Code: Select all

// Printgraphic: Print with a graphic link
function printgraphic($graphic){global $f,$search,$file,$sn,$su,$tx,$pth;$t='&print';if($f=='search')$t.='&f=search&search='.$search;else if($f=='file')$t.='&file='.$file;else if($f!=''&&$f!='save')$t.='&'.$f;return '<a href="'.$sn.'?'.$su.$t.'" class="menu">'.'<img class="printgraphic" src="'.$pth['folder']['templateimages'].$graphic.'" border="0" alt="'.$tx['template']['print'].'" title="'.$tx['template']['print'].'">'.'</a>';}
Then you could use the following code in your template:

Code: Select all

<?=printgraphic('mypic.gif');?>

mads
Posts: 22
Joined: Wed Jun 04, 2008 11:47 pm
Location: Århus Denmark
Contact:

Re: Using imagemap for a link to printpage-funkction

Post by mads » Thu Jun 05, 2008 8:54 pm

Ok, I see your idea johndoe.

But this will still be a solution nr 4, not nr. 3 that I want. As an imagemap.
Its not a independent graphic that I use for the printicon, but a 'hotspot'-hyperlink in the topbanner.
I works fine with links to contact page, sitemap etc. Only the 'Printpage' does'nt do the work...
Please take a look: http://www.bmail.dk/worlddance08 (Upper left corner)

This is my imagemap code from my template:

Code: Select all

<map name="m_template_r1_c1" id="m_template_r1_c1">
<area href="index.php" target="_self" alt="Velkommen til Worlddance" shape="rect" coords="6, 6, 549, 93">
<area href="?&print" alt="Printvenlig version _virker ikke pt_" shape="rect" coords="765, 8, 784, 28">
<area href="?Kontakt:Links" alt="Links til samarbejdspartnere" coords="737, 9, 757, 28">
<area href="?Kontakt" alt="Kontakt Worlddance" shape="rect" coords="711, 9, 731, 26">
<area href="index.php" alt="Worlddance.dk startside" shape="rect" coords="684, 9, 704, 29">
<area href="?&sitemap" alt="Overblik over worlddance.dk" shape="rect" coords="656, 8, 677, 28">
</map>
Get my point?

:-) Mads

manu
Posts: 1090
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: Using imagemap for a link to printpage-funkction

Post by manu » Fri Jun 06, 2008 10:22 pm

For your printlink, did you ever try something like

Code: Select all

....href="?<?echo $su;?>&print"...
(for cmsimple variables refer to http://www.cmsimple.com/?Developer%27s_ ... _functions) or just download one of the free templates from the resellers, there are several of where the links are displayed by graphics.
regards
manu

mads
Posts: 22
Joined: Wed Jun 04, 2008 11:47 pm
Location: Århus Denmark
Contact:

Re: Using imagemap for a link to printpage-funkction

Post by mads » Mon Jun 09, 2008 2:24 am

Hi manu;
Thanks a lot, that was exactly the hint I was looking for! :D

Code: Select all

....href="?<?echo $su;?>&print"...
Did the work!

Post Reply