Skip to content

dart-creations.com

Advertisement
Home arrow Web Development arrow #20 - Show / Hide a template position based on component displayed
Print E-mail
Tuesday, 11 September 2007

#20 - Show / Hide a template position based on component displayed 

Recently 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
                    global $option;
                    if ($option!='com_xxxx')

                   {
                        mosLoadModules ( 'position');
                      }
              ?>

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.

Comments
Search RSS
Only registered users can write comments!

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Wednesday, 01 October 2008 )
 

Sponsors

Login Form






Lost Password?
No account yet? Register

Buy us a beer!

If we've helped you, consider buying a beer €3. It will inspire us to keep on giving! Cheers!


Generated in 0.31105 Seconds