Forums / Templates, Stylesheets, Page Layout / need to add a div on all pages, best way?

need to add a div on all pages, best way?

Locked

Started by chandy on 22 Nov 2009, 11:58 AM · Views: 1,568

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
22 Nov 2009, 11:58 AM
#1
chandy avatar

chandy

New Zenner

Join Date:
Feb 2007
Posts:
25
Plugin Contributions:
0

need to add a div on all pages, best way?

I need to add a new div which will contain all the page content. This is because I need to have two background images on all pages. What is the best way to acheive this?
I need

<body> <div id="myDiv"> ....all the current page html... </div> </body>

Will the existing CSS still work and how can I do this in a supported way? I have my own theme/template running so can use the overrides system.

Thanks.

22 Nov 2009, 12:33 PM
#3
chandy avatar

chandy

New Zenner

Join Date:
Feb 2007
Posts:
25
Plugin Contributions:
0

Re: need to add a div on all pages, best way?

Excellent, exactly what I needed.

Thanks tino.

17 Dec 2009, 2:39 AM
#4
bobobo avatar

bobobo

New Zenner

Join Date:
Dec 2009
Posts:
5
Plugin Contributions:
0

Re: need to add a div on all pages, best way?

Hmmm, actually the file "tpl_main_page.php " is not located in the folder of any of my templates. For sure (I triple-checked) the only contents are:

  1. "css" folder
  2. "images" folder
  3. template_info.php

What can I modify to add an extra div page container?

17 Dec 2009, 4:20 AM
#5
tino_schlegel avatar

tino_schlegel

Totally Zenned

Join Date:
Nov 2007
Location:
Melbourne, Australia
Posts:
532
Plugin Contributions:
0

Re: need to add a div on all pages, best way?

The name 'YOUR_TEMPLATE' have to be replaced with the name of your template folder. For the classic temaplte it is 'classic'. If you have installed another template, the name is different. Read the tutorial about the override system to understand the folder structure.

17 Dec 2009, 8:42 AM
#6
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,747
Plugin Contributions:
56

Re: need to add a div on all pages, best way?

Just like you have created YOUR_TEMPLATE/css/stylesheet.css, you can create YOUR_TEMPLATE/common/tpl_main_page.php as Tino has suggested. You can mirror anything from includes/templates/template_default in your own includes/templates/YOUR_TEMPLATE folder, and customize as desired. You don't currently have a "common" folder simply because you haven't yet changed anything. The beauty of the Zen Cart override system is that you only have to create things as you need to change them.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

17 Dec 2009, 11:54 PM
#7
bobobo avatar

bobobo

New Zenner

Join Date:
Dec 2009
Posts:
5
Plugin Contributions:
0

Re: need to add a div on all pages, best way?

Ahhh, you guys are awesome! And you responded so fast! I created the new YOUR_TEMPLATE/common/tpl_main_page.php file, and now my div works. Thank you so much! :clap: