How to detect template is on frontpage in joomla?



Many programmers want to put a script in joomla template that only run at home page. I recommend here two solution that i get from digital point forum:

1. Solution 1

you can simply put a module position and make it only display on frontpage. When this module display, it means we are on front page. Put a code of javascript here. For example: you have a funtion myonload() {...}; put in the area of this module. Hope that help you!

2. Solution 2

Put this code between tag of template:

 getActive() == $menu->getDefault()) { ?>  




Responses

0 Respones to "How to detect template is on frontpage in joomla?"

Post a Comment

 

Link Liên kết

Thông tin liên hệ

YH: huonggiangdhtn
Skype: tthuonggiang
Return to top of page Copyright © 2010 | joomla extensions jw-extension.net