[Typo3] Print version

Christopher bedlamhotel at gmail.com
Fri May 20 05:04:22 CEST 2005


Hi,

On 5/19/05, racco <raczek at open.infi.pl> wrote:
> Because I have it opened in a separate small window. And if for example I
> want to print site with news, which are always ended with link "read
> more..." in this window if they will be activ, clicking on them will jump to
> what is in <a> tag "read more...".
> 
> That's the reason.
> 
> http://www.zoon.com/ - it is the example of what I would like to have;
> choose  Druckversion  on the right top, under flash animation.
> 

Well, honestly, the two simplest ways to do this are probably something like - 

a) Use your stylesheet to hide links on printable pages:

@media print {

/* Note that if you're using this method, it's probably easier not to
make 'printable pages' at all, but just use CSS to display a totally
different page when printing... */

/* Anyway, first, disguise all the links... */

  a {
    color:#000; /*  ...or whatever colour the rest of your text is... */
    text-decoration:none;
    font-weight:normal;
  }

/* Secondly, remove the navigational links (since we don't need to
navigate in printable pages anyhow... */

  #navigation {display:none;} /* If the parent container of your
navigation menu contains this: 'id="navigation"', this will make it
disappear in your printable pages... */

  .hide {display:none;} /* Make your 'more' links like this: <a
href="path/to/file.html" class="hide">More...</a>, and this will make
them disappear in your print pages... */
}


b) Using javascript to change the 'href' attribute of all the links in the page:

<script type="text/javascript">
function turnOffLinks() {
	alert('I am being called!');
	var linkCollection = document.getElementsByTagName('a');
	
	for (var i = 0; i < linkCollection.length; i++) {
	  linkCollection[i].href = '#';
	}
}
</script>

You should be able to keep Typo3 from rendering links in the first
place by fiddling with lib.parseFunc in the TS object browser, but
both of the above methods will be easier and possibly more complete
solutions...


-Christopher



More information about the TYPO3-english mailing list