Customizing Page Layout

11 posts by 3 authors in: Forums > CMS Builder
Last Post: April 23, 2010   (RSS)

I have a database that I am setting up that has products that are associated by product brand and product type.

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

Hi,

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

How would I link it to its own page?



<link ="href">???

Re: [dccreatives] Customizing Page Layout

By Jason - April 14, 2010

Are you wanting to link it to its own static page?

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

I want to change the page for each brand. I am not changing it based on css stylesheets. There are more cosmetic changes than just css. Can't I define a detail page for each brand?

Re: [dccreatives] Customizing Page Layout

By Jason - April 15, 2010

Hi,

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

Sorry for sounding clueless, but where would I put this link? and where do I specify in the brand sections which page to use? Do I hard code it?



Please clarify.

Thanks

Re: [dccreatives] Customizing Page Layout

By Jason - April 15, 2010

No problem.

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: [dccreatives] Customizing Page Layout

I got the brands to work. Now I need each Brand detail page to be different as well. What would be the code to place on the List page that lists each items to specify which detail.php page to use?



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.