Joomla
Joomla Tips and Tricks
#20 - Show / Hide a template position based on component displayed
|
|
#20 - Show / Hide a template position based on component displayedRecently we were using a custom module position to load a slideshow module permanetly in the main body of a site. However as part of the site we wanted to use another component. The second component did not fit comfortably with the previous slideshow module. Therefore we wanted a way of hiding the slideshow module based on whether the 2nd component was being displayed or not. The way to do this is to slightly hack the template (index.php). Basically there exists a global variable $option which determines which component is being displayed if any. The hack is therefore the following: <?php { change to $option=='com_xxxx' to show only when a component is displayed where com_xxxx is the component you want to base your show/hide code on. The above will hide the position module when the com_xxxx component is displayed. |