PDA

View Full Version : Style based layouts...


James Goddard
10-27-2005, 10:33 PM
I want to have differen't layouts based on the style the user has chosen.

For example:

If the user has chosen a fluid style I want a 3 colums on the index page. If the user chooses a jello style, then I only want 2 colums.

Best way I can figure to do this is to bascly add each module twice, once where I would want it in a 2 column layout and once where I would want it in a 3 column layout. And have 2 pages one that turns on the 2 column modules and another that turns on the 3 colum modules. And finally, modify index.php to choose the page to display based on the style.

While I think this would work, it's obviously not pretty. Is there a better way to do this?

James

Brian
10-28-2005, 11:30 AM
Depending on how good you are with PHP and such, it might be better just to modify the $modules array in the vba_cmps_include_bottom.php file. I would look for this line in that file:
// Process Active Modules

And then add something like this right above it:
if ($style['styleid'] == X)
{
$modules['1']['modcol'] = Y; // 0 = left, 1 = center, 2 = right
$modules['1']['displayorder'] = Z;
}

Change X to the styleid. Then the code $modules['1'] is going to affect the module with a modid of 1 (should be online users on a default install). Then just find the modid of any other modules that should be affected and add some more code for them. Shouldn't be too hard if you have a basic understanding of PHP. If you have any problems though let me know.

Our Sponsors
 

pennylessz28
10-28-2005, 11:47 AM
I did this with templates.

James Goddard
10-28-2005, 11:58 AM
Depending on how good you are with PHP and such, it might be better just to modify the $modules array in the vba_cmps_include_bottom.php file. I would look for this line in that file:


Works perfectly and a lot less cluttered than my idea. Thanks again!