nijicp 0 Newbie Poster

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.

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. But the template is not assigned at the desired position on loading the module at first.

Why is this happening? Any Solution??

Thanks in advance,

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.