help to better help you:

Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!

change printer-icon section in print popup

change printer-icon section in print popup

11 years 2 weeks ago - 11 years 2 weeks ago
#17879
If you wondering how to change the layout in the print popup then here some information.

Let's say we have a printer icon in the eventslist-view


and when pressed it will be looking like this image


so how did i change the icon part?


did add this code in the default_events_table.php
Code:
<div id="printer_icon"> <div class="printer_icon center"> <?php $text = JHtml::_('image', 'com_jem/printer.png', JText::_('COM_JEM_PRINT'), 'title="Afdrukken"', true); $desc = JText::_('Klik om het overzicht af te drukken'); $title = JText::_('Afdrukken'); $tip = JHtml::tooltipText($title, $desc, 0); $url = '#'; $attribs = array(); $attribs['title'] = $tip; $attribs['class'] = ''; $attribs['onClick'] = 'window.print();return false;'; $output = JHtml::_('link', JRoute::_($url), $text, $attribs); echo $output; ?> </div></div>

did add this code in jem.css
Code:
div#jem div#printer_icon { display:none; }
doing so will hide the div when a visitors views eventslist normally.

did add this code in print.css
Code:
div#jem div#printer_icon { display:block; margin-top: 10px; margin-bottom: 10px; height: 40px; }
doing so will show the div when a visitor clicks at the print-icon.


i know it ain't perfect but it gives an idea.
and yes i'm hardcoding language strings at the moment and as i'm not using different languages it ain't a problem for me.
Last edit: 11 years 2 weeks ago by Bluefox.

Please Log in or Create an account to join the conversation.

Re: change printer-icon section in print popup

11 years 2 weeks ago
#17880
Hm... I don't understand the use-case. :unsure:

On normal page you will have a button which opens the print preview popup.
In this popup a slightly different layout is shown with a completely different button to send this page to a printer.
So there is no need to hide any button because there should be only one of these two buttons present.

It should be useful to add a line "$this->print = $print;" in the view.html.php files where missing to make it easier within the template but then I would check this flag to decide how to construct the content.

Please Log in or Create an account to join the conversation.

Re: change printer-icon section in print popup

11 years 2 weeks ago
#17881
well it's was more about hiding/showing a block.

basicly it's possible to show anything in the print.css (not only the printer icon). The code for the printer-icon in the output class is indeed looking for the print variable so guess i should have made a better example :)

Please Log in or Create an account to join the conversation.

Re: change printer-icon section in print popup

11 years 2 weeks ago
#17882
Ok, then let's make a very little css lesson. ;)

Code:
#whatever { display: none; }
will completely hide the element with id whatever, also not taking any space for that as if it wouldn't exist.

Code:
#whatever { show: hidden; }
instead will also hide the element with id whatever, but takes space as if the element would be shown.

In most cases "display: none" is the best choice but if things should be toggled dynamically, e.g. depending on user selections "show: hidden" could be useful to prevent jumping elements.
The following user(s) said Thank You: Bluefox

Please Log in or Create an account to join the conversation.

Time to create page: 1.778 seconds