Benchmark Reviews Discussion Forum Right Header

Go Back Benchmark Reviews Discussion Forum > Software > Web Design & Development

Web Design & Development Discussion ranging from HTML to SEO, PHP to XML, and everything else inbetween.

Reply
Thread Tools Display Modes
#1
Old 12th May 2011, 11:16 PM
nijicp nijicp is offline
Bit
Join Date: May 2011
Posts: 1
Loading two template files of same module in two positions

Hey..

I am working on a new project and I am using Joomla version 1.5.22.
I need to display one horizontal search form in the middle of home page and the same search form in vertical style in all other pages but in left position.
So what I did is, I created two template files one for horizontal search(horizontal.php) and other for vertical search (vertical.php) and in mod_modulename.php I tried to load the respective modules based on a certain condition and changed the position left or middle according to it. The positions are changed in the database to get effected in the admin panel.

PHP Code:
 if(condition) {
   
modModulenameHelper::changeToVertical($position);   //changed the position in database to left 
    
require( JModuleHelper::getLayoutPath'mod_modulename''vertical'));
    } 
else {  
    
modModulenameHelper::changeToHorizontal($position);  //changed the position in database to middle
    
require( JModuleHelper::getLayoutPath'mod_modulename''horizontal')); 
But I am not getting the correct output. It is loading the respective modules based on the condition. But the position is not assigned at first. And if I press Ctrl+F5 or refreshes, the page will be loaded with the desired output.
Why is this happening? Any Solution??

Thanks in advance,
Reply With Quote
#2
Old 15th May 2011, 02:39 PM
Olin Coles's Avatar
Olin Coles Olin Coles is offline
Executive Editor
Join Date: Feb 2007
Posts: 2,951
Hello: Thanks for posting, but I think this would be a question better suited for the Joomla.org discussion forum or perhaps WebmasterWorld. Good luck!
__________________
You can follow Benchmark Reviews on Facebook and Twitter!
Reply With Quote
Sponsored links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 03:58 PM.

Benchmark Reviews Discussion Forum
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Remove advertisements

Follow Benchmark Reviews on FacebookReceive Tweets from Benchmark Reviews on Twitter