views:

173

answers:

1

So basically, the print functionality does not work by default in Joomla but I've fixed that with some code modifications. However, this functionality is only available in the articles. I have a blog component and I need to make the print button available in the blog entries too

Does anyone knows the code for this? Or knows the files I need to edit?

Many Thanks in advance.

+1  A: 

The print functionality is essentially loading your page with &tmpl=component added to the URL. This request variable tells Joomla to load the page, but only with the output from <jdoc:include type="component" />. The modules and the rest of the template get hidden.

For the icon, the com_content component is actually using its own helper library in components/com_content/helpers/icon.php. You're best off using line 145 from that file:

JHTML::_('image.site', 'printButton.png', '/images/M_images/', NULL, NULL, JText::_( 'Print' ) );

This will generate the <img /> tag for the printer icon.

jlleblanc
Unfortunately when I added this code to the blog component, it did not generate the print button.
Chris
Did it generate any HTML output at all?
jlleblanc