Page not printing when clicking "Print" button in K2 article

September 2015 Joomla Template
GK User
Mon Nov 28, 2016 8:48 am
When I click at the Print button in an K2 article the popup window with the printable information opens. But then the print window don't open and I have no print button to click on in the popup. I have to right click and hit Print for it to do so.

Can someone please take a look and advise me how to fix it?

https://goo.gl/NxgiEq
User avatar
Senior Boarder

teitbite
Fri Dec 02, 2016 12:10 pm
Hi

Works when I try, but I've noticed that "Print" button is disabled. Try editing /component.php and add this between <head></head>

Code: Select all
.itemFeature, .itemPrintThisPage {
    display: block;
}
User avatar
Moderator

GK User
Mon Dec 05, 2016 9:54 am
teitbite wrote:Hi
Works when I try, but I've noticed that "Print" button is disabled. Try editing /component.php and add this between <head></head>

Code: Select all
.itemFeature, .itemPrintThisPage {
    display: block;
}


Thank you. That worked great for K2 articles.

For regular Joomla articles I had to add this code above <div class="item-body" itemprop="articleBody"> in file /templates/gk_technews/html/com_content/article/default.php:
Code: Select all
<?php if(JRequest::getInt('print')==1): ?>
<!-- Print button at the top of the print page only -->
<a class="itemPrintThisPage" rel="nofollow" href="#" onclick="window.print();return false;">
   <span><?php echo JText::_('K2_PRINT_THIS_PAGE'); ?></span>
</a>
<?php endif; ?>


I don't know if thats the right way to do it but it works!
User avatar
Senior Boarder

teitbite
Thu Dec 08, 2016 1:36 pm
Hi

Thank You for shearing. I will pass this fix to programmers. Thread closed.
User avatar
Moderator


cron