Actions

J1.5

Difference between revisions of "Adding template overridable images in your extension"

From Joomla! Documentation

m (Details)
m (− 5 categories; +Category:Archived version Joomla! 1.5 using HotCat)
 
(3 intermediate revisions by 2 users not shown)
Line 14: Line 14:
 
*Don't forget to insert the image in your extension's zip package and in the XML configuration file.
 
*Don't forget to insert the image in your extension's zip package and in the XML configuration file.
 
*If you don't specify a folder, the folder "/images/M_images" will be initially searched for  in the front-end, "/images" in the back-end.
 
*If you don't specify a folder, the folder "/images/M_images" will be initially searched for  in the front-end, "/images" in the back-end.
*If you want to know more: [http://api.joomla.org/Joomla-Framework/HTML/JHTMLImage.html JHTMLImage] is the class called by this JHTM.
+
*If you want to know more: [http://api.joomla.org/1.5/Joomla-Framework/HTML/JHTMLImage.html JHTMLImage] is the class called by this JHTM.
  
 
= Reference =
 
= Reference =
 
Based on this forum topic: [http://forum.joomla.org/viewtopic.php?f=304&t=376106&start=0 JHTML image.site; Where to put the fail back images ?]
 
Based on this forum topic: [http://forum.joomla.org/viewtopic.php?f=304&t=376106&start=0 JHTML image.site; Where to put the fail back images ?]
[[Category:Development]]
+
 
 +
[[Category:Archived version Joomla! 1.5]]

Latest revision as of 22:03, 7 May 2013

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Introduction

If you want to use images in your extension and you want to offer Joomla site administrators the option to customize it (via the template), this is the way to do it. Administrators or (template) designers will then be able to override your images via the template (images folder).

Code

Wherever you need the image (in html), use this code:

echo JHTML::_('image.site', 'myimage.png','/plugins/content/mypluginfolder/');

Details

  • This means that:
    • IF there is a template myimage.png found back at "[template folder]/images", use this one
    • IF NOT use the one in "/images/M_images".
  • This is for front end images, for back-end images replace "image.site" with "image.administrator".
  • Don't forget to insert the image in your extension's zip package and in the XML configuration file.
  • If you don't specify a folder, the folder "/images/M_images" will be initially searched for in the front-end, "/images" in the back-end.
  • If you want to know more: JHTMLImage is the class called by this JHTM.

Reference

Based on this forum topic: JHTML image.site; Where to put the fail back images ?