Customizing Page Layout
11 posts by 3 authors in: Forums > CMS Builder
Last Post: April 23, 2010 (RSS)
I need the detail page of each product for each brand to have it own template and layout. But when I go to generate the code for the product, there is only one listpage and one detail page for each section. How can I customize that if the item is this brand, use this template and not the other.
Please advise.
Re: [dccreatives] Customizing Page Layout
By Jason - April 14, 2010
The code generator outputs only a basic layout that can then be fit into any template. If you need to change the template (i.e. the css file being used) you could try something like this:
<?php if($record['brand']=="BRAND") : ?>
<link rel="stylesheet" type="text/css" href="template1.css" media="all" />
<?php endif ?>
You could set up a series of these if statements in the head section so that you only use a certain template based on what the brand is. Of course you'll have to change the names used in the code to match what you have on your page and in your database.
Hope this helps.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Customizing Page Layout
<link ="href">???
Re: [dccreatives] Customizing Page Layout
By Jason - April 14, 2010
The way CMS Builder usually works is it displays content dynamically. That way if you have 100 products, you don't need 100 pages to display them. You would have one page that would display a different product depending on what was selected.
How are you wanting to change the template for each product? Do you just want to change the CSS file, or is it suppose to go to a unique page?
Let me know and we'll try to work it out.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Customizing Page Layout
Re: [dccreatives] Customizing Page Layout
By Jason - April 15, 2010
Sure, you can create a separate detail page for each brand if you like.
An easy way to do this would be to store the name of the detail page (ex. brand1.php) in the brand section so that it will be easy to link to.
The link could then look like this:
<a href="<?php echo $record['link'] ?>"><?php echo $record['name'] ?></a>
Hope this helps.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Customizing Page Layout
Please clarify.
Thanks
Re: [dccreatives] Customizing Page Layout
By Jason - April 15, 2010
If you want to create an individual page for each brand, you can go into the brand section of CMS Builder, and add a field called link. Then, you can modify each of your brands and put the name of the file you want each brand to link to (ie, brand1.php, brand2.php, etc)
Where ever you are outputting a list of brands, you can put in a link to that page that could look like this:
<a href="<?php echo $record['link'] ?>"><?php echo $record['name'] ?></a>
When the page loads, the link would look something like this:
<a href="brand1.php">Brand 1</a>
Note that this is just an example. You'll have to change names to fit what you have in CMS builder.
Give that a try. If you run into any issues, attach the page and I'll take a look at it for you.
Hope this helps.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Customizing Page Layout
Re: [dccreatives] Customizing Page Layout
I already added in the admin a field called link, but when I use the following code: <a href="<?php echo $record['link'] ?>"><?php echo $record['name'] ?></a>, it does not include the item id to the link, so it does not take me to the detail page. i.e. the page that has the "?" and the product id.