1

I want to show a simple "email to friend" button on my Joomla articles (3.9.5) The Articles global options allows Email and Print actions to be added, but they are then "hidden" behind a blue cog icon. I just want to show the icons directly because hiding this behind a cog wheel is too hard for the users I have in mind. The convention is to show an email icon (not hidden behind another click).

I want to avoid an extension which does social media sharing because it is over the top, I just want an email article link, and Joomla's standard feature looks fine (apart from the way it is presented).

I can't find which php file I should override. I have not over-ridden Joomla php before, but from documentation I've read, it doesn't look too hard.

I guess what I am looking for is in

/var/www/html/components/com_content

but I am not making any progress.

Can anyone point me in the direction of which file I should override. Recursive grep is not being very helpful to me (because I don't know what to look for).

1

The default Joomla code doing the call to display the icons can be found in .../components/com_content/views/article/tmpl/default.php starting at line 68.

At Line 70 this calls a layout routine to process which options are set(edit,print,email) and write the html to display the icons.

You can find the the layout code in.../layouts/joomla/content/icons.php and .../layouts/joomla/content/icons/email.php (updated)

You can create overrides for both of the files mentioned using the standard feature under the Templates menu.

Beware though when you elect to override the layouts/joomla/content it will copy All of the layouts so you will need to delete all the ones you don't want to change or you could run into issues later on when core updates aren't being reflected on your site.

  • path correction: ../layouts/joomla/content/... – Tim Richardson Apr 13 at 23:52
  • the dropdown menu is in ../layouts/joomla/content/icons.php Thanks. – Tim Richardson Apr 13 at 23:53
  • @Tim I have updated the path and made it clear that there are three locations, thank you. There is actually more related code in .../components/com_content/helpers/icon.php that might be of interest to you. – Irata Apr 14 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.