Use print & email icons to make your Joomla site more understandable

Last Updated:
Category:
Customization Tips

We all know that sometimes your clients expect typical icons instead of “modern” text links for print and email icons in article views like it was in the default joomla templates – that’s why we’ve prepared this short but useful guide.

icons-print-email-joomla

Before customization

First of all, you have to modify our override file in the GK template:

 templates\gk_TemplateName\html\com_content\article\default.php

You can use one of the following techniques for replacing our code to use custom icons:

  • using HTML img tag
  • or using J! code.

Both are simple, and the second one just needs a simple copy & paste from the following code.

For a PRINT icon, please find in the source code file:

<?php echo preg_replace('@<img.*?alt="(.*?)".*?\/>@mis', '$1',JHtml::_('icon.print_popup',  $this->item, $params)); ?>,

and replace it with:

<?php echo JHtml::_('icon.print_popup',  $this->item, $params); ?>

For an E-MAIL icon, please find:

<?php echo preg_replace('@<img.*?alt="(.*?)".*?\/>@mis', '$1',JHtml::_('icon.email',  $this->item, $params)); ?>

and replace it with

<?php echo JHtml::_('icon.email',  $this->item, $params); ?>

Now upload the changed file to your template folder on your server.

Default icons for print & email - after customization

Default icons for print & email – after customization

Those icons are also from the template folder, so you can upload/replace with your own PNG icons (16 x 16 pixels).

  • templates/gk_TemplateName/images/system/printButton.png
  • templates/gk_TemplateName/images/system/emailButton.png
Use print & email icons to make your Joomla site more understandable 2.835 (56.67%) 6 votes

This article was first published

Villa Belluci - View our NEW theme
×

Tutorials & tips delivered regularly

Expand your purchase with regular tutorials and tips to making your site better, direct to your email.