How can one change the content of what {print} does? Topic is solved

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
Duketown

How can one change the content of what {print} does?

Post by Duketown »

Hi,

When installing standard CMSMS, a print of the page is possible thru the icon on the upper right. Another option is to use the tag {print}.
All information that is presented on the generated page will be shown on the print page.
Is it possible to influence the content of the page that is shown once the {print} hyperlink is used?

In my situation, I want to influence the outcome of a cataloger item page. For example on the page to print, I don't want the image which is available on the prepared item page.

Duketown
User avatar
webform
Power Poster
Power Poster
Posts: 507
Joined: Sat Nov 25, 2006 3:39 pm

Re: How can one change the content of what {print} does?

Post by webform »

Add a class to your images and then add that class to your print css.

Do the same for other areas!
Duketown

Re: How can one change the content of what {print} does?

Post by Duketown »

Thanks for the quick reply, but I still don't get it. Setting and passing a class in my vision only changes the way the image of the hyperlink is styled.
If for example I have prepared an attribute Weight in Cataloger. This weight should be shown on a regular page, but once the visitor is going to print the page, the weight should not be there.

So I don't want specific parts to be printed, but they should be shown on a page.

Duketown
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: How can one change the content of what {print} does?

Post by Rolf »

Default Print stylesheet contains:

Code: Select all

/* 
no need for accessibility on printout. 
Mark all your elements in content you 
dont want to get printed with class="noprint"
*/
.accessibility,
.noprint
 {
display:none !important; 
}
Like Webform said, you can add class="noprint" to the areas you don't want to show up in the printed page.

Grtz. Rolf :)
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Duketown

Re: How can one change the content of what {print} does?

Post by Duketown »

I'm still strugling with this issue. Rolf thanks, finaly found what you meant with the Default Print stylesheet (for others: when installing CMSMS there is also a stylesheet installed that has the name Print. When you look in the Printing module there is a template that mentiones {cms_stylesheet media='print' templateid=$templateid}. This tag retrieves all the installed stylesheets that have as media type 'print'.)

Turned out that the tag {print} doesn't work in my installation (1.9.2) since when used only a blank page is shown. From one of the earlier placed threads a solution would/could be to use {oldprint}. That works as expected with regards to all material being outputted.
However with the {oldprint}, I'm not so sure if the {cms_stylesheet meida="print"...} is done and as a consequence I can't get the noprint to work as expected.

Best option here would be that {print} is working again. Anyone an idea how to tackle hide/noprint not working situation.

Thanks,

Duketown
Post Reply

Return to “CMSMS Core”