Design and CSS styles
Version 4.x > Design and CSS styles > Problems adding print this page link to content pages View modes: 
User avatar
Member
Member
awolfe-edfinancial - 4/5/2010 9:51:41 AM
   
Problems adding print this page link to content pages
Hello, I'm trying to add a Print this Page link to some of my web pages in Kentico. I'm using the documentation in the Dev Guide for 4.1 found here: http://kentico.com/Docs/DevGuide31a/index.html?print_page.htm

I'm having trouble defining the content that displays on the printable page. I
think it's an issue with the Path that I'm selecting, or the transformation, or both. What path should I use if I want to see only a single page's content on the printable page? In the repeater web part on the blank page template for print, if I leave the path field blank, nothing shows on the printable page. If I use /%, then I see everything on my site. If I use /{0}/%, which is what I thought would work, I see nothing. Also tried a period, and that just displayed the name of the blank print page on the print page.

Here's the code in the Text field of my PrintLink web part (on every content page that I want to be printable):

<div class="PrintLink">

<br />

<a href="~/Print-This-Page.aspx?printpath={%NodeAliasPath%}&classname={%ClassName%}" target="_blank" >

Print this page


</a>

</div>

Here's my transformation in the repeater web part on the blank page:
<div class="printContent">
<h1><%# Eval("documentname") %></h1><br />

<%# Eval("documentcontent") %>

</div>


Thanks, Amanda

User avatar
Member
Member
awolfe-edfinancial - 4/12/2010 8:32:38 AM
   
RE:Problems adding print this page link to content pages
I figured this out. We don't have the Corporate example site on our CMS anymore, but all the templates are there. I went and looked at the template used for the print page in the original Corporate site and saw the path should be {%printpath|/%%}, which was listed in the documentation, but I thought this path was an example and had to be more specific based on my site structure. Working now. :)