Page 1 of 1

Is there a way to print just a section of a page?

Posted: Sat Feb 22, 2014 12:40 pm
by fiddler
I'm not sure if this is the correct board to post this question to, but here goes. I am using 1.10.2 "Casa Pilote" and am using the News Module to post obituaries to a funeral home website. Additionally, I am using the CG Feedback module so people can post condolences under the obits. Adding the {print} brings up the entire obit page for printing but the funeral director wants people to be able to print out the obits without the condolences. Is there some param I can use to only call up a section of that page and stop it from printing out the entire page? I've told the funeral director to either copy and paste the obit only into word or tell the printer to print one page only, but that isn't a satisfactory answer for him.

Re: Is there a way to print just a section of a page?

Posted: Sat Feb 22, 2014 1:08 pm
by velden
Extensions->CMSPrinting->Print Template (tab)

That gives you all control you need doens't it?

Re: Is there a way to print just a section of a page?

Posted: Sat Feb 22, 2014 1:56 pm
by fiddler
I'm not understanding how this can be altered to print only a section of the page, since the CG Feedback code is part of the template - here's the code:
{* set a canonical variable that can be used in the head section if process_whole_template is false in the config.php *}
{if isset($entry->canonical)}
{assign var='canonical' value=$entry->canonical}
{/if}

{if $entry->postdate}
<div id="NewsPostDetailDate">
{$entry->postdate|cms_date_format}
</div>
{/if}
<h3 id="NewsPostDetailTitle">{$entry->title|cms_escape:htmlall}</h3>

<hr id="NewsPostDetailHorizRule" />

<div id="NewsPostDetailContent">
{eval var=$entry->content}
</div>

{if $entry->extra}
<div id="NewsPostDetailExtra">
{$extra_label} {$entry->extra}
</div>
{/if}

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


{if $return_url != ""}
<div id="NewsPostDetailReturnLink">{$return_url}</div>
{/if}

{if isset($entry->fields)}
{foreach from=$entry->fields item='field'}
<div class="NewsDetailField">
{if $field->type == 'file'}
{* this template assumes that every file uploaded is an image of some sort, because News doesn't distinguish *}
<img src="{$entry->file_location}/{$field->value}"/>
{else}
{$field->name}:&nbsp;{eval var=$field->value}
{/if}
</div>
{/foreach}
{/if}
--------------------------------<br />
{print text="Print this page"}
<br />Share this.<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style "><center>
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
</center>
</div>
{literal}
<__script__ type="text/javascript" src="http://s7.addthis.com/js/250/addthis_wi ... >{/literal}
<!-- AddThis Button END --><br />
<br />
<table width="400px"<tbody><tr><td>
<h3>Condolences to the Family</h3>
{CGFeedback key1="News" key2=$entry->id action='summary'}
{CGFeedback key1="News" key2=$entry->id}
</td></tr></tbody></table>

Re: Is there a way to print just a section of a page?

Posted: Sat Feb 22, 2014 3:45 pm
by Jo Morg
Not tested, but the way I see it your options would be to either remove the calls to CGFeedback from the News template to the main template, or maybe even better assign them an only use the respective assigned values if they exist on the main template.

Something like:

Code: Select all

{* News detail template *}
{CGFeedback key1="News" key2=$entry->id action='summary' assign='CGF_Summ'}
{CGFeedback key1="News" key2=$entry->id assign='CGF_Detail'}
and then:

Code: Select all

{* Main page template *}
{if isset($CGF_Summ)}
{$CGF_Summ}
{$CGF_Detail}
{/if}
Assuming you are not using the includetemplate template only the content should be printed.

HTH

Re: Is there a way to print just a section of a page?

Posted: Sat Feb 22, 2014 4:50 pm
by fiddler
Oh, I think I understand. I'll give it a shot and let you know how I make out.

Thanks.

Re: Is there a way to print just a section of a page?

Posted: Sat Feb 22, 2014 5:32 pm
by velden
And that about a quick and dirty way: remove the comments by hiding them via print media specific css?