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.
modModulenameHelper::changeToVertical($position); //changed the position in database to left
require( JModuleHelper::getLayoutPath( 'mod_modulename', 'vertical'));
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,