Page 1 of 1

How to change print anchor in News from text to image

Posted: Wed Oct 24, 2007 9:51 am
by Milhaus
Hi,

I recently managed to change text "Print" to image in News detail and think, this might be useful for someone, who doesn't know CMSMS API.

Firstly, you can see here what I mean:

Image

The steps:

Change:

Code: Select all

<div id="NewsPostDetailPrintLink">
{$entry->printlink}
</div>
to:

Code: Select all

<div id="NewsPostDetailPrintLink">
<a href="{$entry->printlink}"><img src="images/cms/printbutton.gif"></img></a>
</div>
in your News (detail) template file.

Next, change in your action.detail.php file:

Code: Select all

$onerow->printlink = $this->CreateLink($id, 'print', $returnid, $this->Lang('print'), $sendtoprint);
to:

Code: Select all

$onerow->printlink = $this->CreateLink($id, 'print', $returnid, $this->Lang('print'), $sendtoprint,'',true);
Then it should work. If there will be any problems, let me know. I also would like to know solution, which doesn't require modification of News...

Milhaus

Re: How to change print anchor in News from text to image

Posted: Wed Oct 29, 2008 2:36 pm
by xmas3
Maybe using CSS ?

#NewsPostDetailPrintLink a{
  display: block;   
  width: 40px;
  height: 40px;
  text-indent: -9999px;
  background: transparent url('images/icon_print.gif') left top no-repeat;
  overflow: hidden;}

Width and height are the same of the image size, the charecter Print anchor is made invisible by text-indent.
Other solutions to make it invisible:
color: transparent  -> Mozilla OK, not working in IE and Opera
font-size: 0px; -> Mozilla OK, a small underline in IE and not working in Opera



What do you think about that?

Ahoj, Miro

Re: How to change print anchor in News from text to image

Posted: Wed Jun 03, 2009 9:41 am
by Lucaz