Listing Hits
1115
Rating
0
Created
31 January 2010
Type
  • Non Commercial

simpleSwitch - switch on/off the parts of Joomla templates Link new

Rate this listing
0 vote
Favoured:
0

simpleSwitch Joomla Module enable you to switch parts of a template on/off per page, independently of the presence of other modules and/or other module-positions.

I needed a way show specific HTML/script-parts only on 1 or 2 pages of my website and sure did NOT want to have to deal with article/category/section-ids manually, so i wrote this tiny switch-module that allows me as well as any other admin to publish / unpublish that specific parts of my template per page and do so comfortably via Joomla!-backend.

The usage is very simple:
if($this->countModules('myIndependentPosition')) :
?>

content ( HTML, PHP, JS, Meta-tag, IMG or whatsoever ) goes here ... and will later only be expressed on the page if the simpleSwitch module is 'shown' on that page




You use it just like any other module:

1. First you assign it to your chosen position ( in the example above it's "myIndependentPosition" ).

2. Next you choose on which pages you want it to be published/shown: only on specific pages, or on all pages or on none at all.
This can be defined the usual way in the module-manager → module "simpleSwitch"
Since the switch is realized as a module, you can create an own position for the module in your template if u want, so your free to use it wherever you want in your template, even for instance in the header ( i.g. if you want to controll the inbind of a .css or .js - file or so )