laurie_lewis Posted October 5, 2006 Posted October 5, 2006 Hi, I have STF but not been able to come up with this but I am sure it must have been dealt previously. I want to be able to change from a 2 column layout to a 3 column layout based on the page being viewed. I am imagining I should be able to do this using if statements but not sure of the variables I need to use. this is what I was thinking it would flow like :- if page = contact_us then layout = 3 columns else layout = 2 columns endif While I am at it I was also desiring to be able to have different boxes based on the box that is being built. Thought if's would work again if box is for tell a friend then use this box design elseif box is for manufacturers then use this box design else use this box design endif My main problem is I have no idea :blush: on how to differentiate which pages are being built or which boxes are being built. Any help appreciated :blink: . Laurie
Guest Posted October 6, 2006 Posted October 6, 2006 Hi Laurie. Regarding the different layouts, what about using a contribution like Separate infobox widths. http://www.oscommerce.com/community/contri...ns,3448/page,14 This contrib is a pretty simple alteration, and you could possibly have more than 1 set of parameters for the width of the infoboxes. Have a look at the code in the contrib and you should be able to see what I mean. What I am thinking is that for a 2 column layout, you could cheat a bit and set the right column say, to 1px without a border, which would give the appearance of a 2 column layout without messing around with a heap of code. Regarding calling certain infoboxes depending on what page is being viewed, there are a couple of ways of doing this. You have suggested the elseif way which would work fine, or you could play with something like if (substr(basename($PHP_SELF), 0, 12) == 'product_info') { include(DIR_WS_BOXES . 'filename.php'); } if (substr(basename($PHP_SELF), 0, 5) == 'index') { include(DIR_WS_BOXES . 'filename1.php'); } Hope this helps.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.