Forums / Templates, Stylesheets, Page Layout / What template to add additional divs outside of mainWrapper??

What template to add additional divs outside of mainWrapper??

Locked

Views: 5,351

Results 1 to 20 of 21
This thread is locked. New replies are disabled.
24 May 2007, 6:23 AM
#1
rubelin avatar

rubelin

New Zenner

Join Date:
May 2007
Posts:
3
Plugin Contributions:
0

What template to add additional divs outside of mainWrapper??

I need to add border images to the right and left of the mainWrapper div for all the pages in the entire cart I am working on, but I can't figure out which template controls this. Is there one template that I can add these new divs to or will I need to add them to a ton of templates??

My other thought was to find the template (or code) that includes the opening and closing body tags, because I can add the new divs inside of those and it would work for the whole site. But, again, I don't know where to find that :)

Thank you for the help. I'm really appreciating the great documentation and the new css templating.

25 May 2007, 3:20 AM
#2
rubelin avatar

rubelin

New Zenner

Join Date:
May 2007
Posts:
3
Plugin Contributions:
0

Re: What template to add additional divs outside of mainWrapper??

Does anyone know where I can find this?? Has anyone else been able to add divs outside of the mainWrapper div??

25 May 2007, 3:41 AM
#3
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,680
Plugin Contributions:
0

Re: What template to add additional divs outside of mainWrapper??

Have you looked at tpl_main_page.php?

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

25 May 2007, 4:32 AM
#4
rubelin avatar

rubelin

New Zenner

Join Date:
May 2007
Posts:
3
Plugin Contributions:
0

Re: What template to add additional divs outside of mainWrapper??

Thank you, I just found that one 10 minutes ago :D I keep forgetting to look in the default_templates/common folder

It works great!

11 Jun 2007, 8:41 PM
#5
barricades avatar

barricades

Inactive

Join Date:
May 2007
Posts:
150
Plugin Contributions:
0

Re: What template to add additional divs outside of mainWrapper??

rubelin, I'm trying to do what you were doing but I'm having trouble figuring out what exactly I'm meant to do - or more prescisely where I'm meant to add divs to get a border.

When you say about adding divs "outside of the mainWrapper div" can you tell me where to start and end the divs? I've been messing around with this all day and have finally given up and decided to post.

I'm a bit inexperienced with using divs (having simply used tables) and I basically would love it if you could tell me exactly what you did

thanks in advance

11 Jun 2007, 9:11 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: What template to add additional divs outside of mainWrapper??

In /includes/templates/your_template/common/tpl_main_page.php, find near the top of the file

<div id="mainWrapper">

Add just above that

<div id="mainWrapperLeft"> <div id="mainWrapperRight"> <div id="mainWrapper">

and locate the </div> that corresponds with the mainWrapper div, and add two more </div> below it.

In your stylesheet, put the left shadow as a background image in #mainWrapperLeft, and the right shadow in #mainWrapperRight. You will want to add padding or margins somewhere in there - there are many possibilities depending on exactly how you want this to behave.

Anchor the shadows to their respective sides with

background-position: top left;
Background-repeat: repeat-y;

11 Jun 2007, 10:24 PM
#7
barricades avatar

barricades

Inactive

Join Date:
May 2007
Posts:
150
Plugin Contributions:
0

Re: What template to add additional divs outside of mainWrapper??

Hurray! they're there. Thanks so much. I had tryed something similar but had obviously made an error coz it didnt display corrently. Anyway, they're there now so cheers. I'll play around with margins as you suggested, just have to figure out how to move them so they hug the mainWrapper instead of being right at the edge of the screen!

12 Jun 2007, 4:12 AM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: What template to add additional divs outside of mainWrapper??

Give #mainWrapper a width (770px, 85%, 97%...), but don't give mWLeft & mWRight widths. Give the second outer one (mWR) padding, or give mainWrapper margins equal to shadow width; both will work, and there are other possibilities for certain effects.

Do give mWL margin: auto; so it stays centered in the screen.

13 Jun 2007, 10:57 AM
#9
barricades avatar

barricades

Inactive

Join Date:
May 2007
Posts:
150
Plugin Contributions:
0

Re: What template to add additional divs outside of mainWrapper??

thanks Glenn, I've futtered about with the margins and the placement and such but it's still not hugging the mainWrapper, this is what i have:

#mainWrapperLeft {
background-image:url(../images/leftShadow.gif);
background-position: top left;
background-repeat: repeat-y;
margin: auto;
}

#mainWrapperRight {
background-image:url(../images/rightShadow.gif);
background-position: top right;
background-repeat: repeat-y;
}

#mainWrapper {
background-color: #ffffff;
text-align: left;
width: 770px;
margin-right: 5px;
margin-left: 5px;
}

As I say, I've tried messing about with the above but to no avail. Any idea what I'm doing wrong?

Also I've tried to find some decent tutorials online for Divs but haven't found anything more than really basic stuff - do you happen to know of any good tuts?

cheers!
Dave

13 Jun 2007, 8:34 PM
#10
barricades avatar

barricades

Inactive

Join Date:
May 2007
Posts:
150
Plugin Contributions:
0

Re: What template to add additional divs outside of mainWrapper??

Could anyone even just direct me to a website which has similar css to what I'm trying to get and I could look through FF to see what their css is like

13 Jun 2007, 11:13 PM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: What template to add additional divs outside of mainWrapper??

My site does shadows like this, except that I put the extra divs inside mainWrapper. Of course, the locations of parts of the CSS had to be switched. It shouldn't make a difference, but you might try it and see...

27 Oct 2007, 10:45 PM
#12
touchclothing avatar

touchclothing

Totally Zenned

Join Date:
Jul 2005
Location:
Brooklyn NY
Posts:
498
Plugin Contributions:
0

Re: What template to add additional divs outside of mainWrapper??

None of this worked can someone help figure out why.

Here is what I put in my stylesheet.css
#mainWrapperRight {
background-image:url(http://www.touchcrew.com/touchshop/includes/templates/touchcrew/images/dropsh.gif%29;
background-position: top right;
background-repeat: repeat-y;
}

#mainWrapper {
background-color: #ffffff;
text-align: left;
width: 850px;
vertical-align: top;
}

And this is what I put in my tpl

?>

<div id="mainWrapperRight"> <div id="mainWrapper"> <?php /** * prepares and displays header output * */ require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?>
28 Oct 2007, 6:55 AM
#13
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: What template to add additional divs outside of mainWrapper??

Two points that may help:

There is no reason I know of to use a full http filepath for the background image. Using
background-image: url(../images/dropsh.gif);
will get the desired results, and allow your code to be portable to a test/development environment as well.

It may be necessary for proper function to do the divs in the same way I did them: #mainWrapper with #mainWrapperRight inside it.
Give #mainWrapper the desired width and margin: auto;
Give #mainWrapperRight width: 100%;

#mainWrapper {
    background-color: #ffffff;
    text-align: left;
    width: 850px;
    margin: auto;
    vertical-align: top;
    }

#mainWrapperRight {
    width: 100%;
    background-image: url(../images/dropsh.gif);
    background-position: top right;
    background-repeat: repeat-y;
    padding-right:7px; /*or whatever the shadow width is*/
    }
?>
<div id="mainWrapper">
<div id="mainWrapperRight">
<?php
/**
* prepares and displays header output
*
*/
require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE , $current_page_base,'common'). '/tpl_header.php');?>
```and don't forget to add an extra </div> at the end of the file to properly close the new div.
28 Oct 2007, 10:19 PM
#14
touchclothing avatar

touchclothing

Totally Zenned

Join Date:
Jul 2005
Location:
Brooklyn NY
Posts:
498
Plugin Contributions:
0

Re: What template to add additional divs outside of mainWrapper??

thank you for the posting a reply it worked but if you look at the site why is it inside and not on the out side and why does it not go from top to bottom? here is the site http://www.touchcrew.com/touchshop/

28 Oct 2007, 11:35 PM
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: What template to add additional divs outside of mainWrapper??

You don't see it from top to bottom because you didn't add the
padding-right:7px; /or whatever the shadow width is/
to #mainWrapperRight as recommended; also, the logo is a fixed width, so you need to expand #mainWrapper by the width of the shadow.

To center the page in the screen, add margin: auto; to #mainWrapper as posted above.

5 Nov 2007, 3:47 PM
#16
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: What template to add additional divs outside of mainWrapper??

Is it possible to add a shadowbox style to images? And if so, how would I go about doing it?

thanks

10 Nov 2007, 3:56 PM
#17
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: What template to add additional divs outside of mainWrapper??

Hi everyone,

I was just reading this thread again because I'm trying to find out how to make the shadowbox work in IE like I have it working in FF now. After reading all the posts I now know what a "dumb" post I made before this one lol.

Sorry to be such an idiot :blink:

16 Mar 2009, 10:14 PM
#18
emrico1 avatar

emrico1

New Zenner

Join Date:
Mar 2009
Posts:
55
Plugin Contributions:
0

Re: What template to add additional divs outside of mainWrapper??

Thanks for all the help, especially gjh42.

I have been successful so far with this but my backgroud .png's lose transparency when I move them inside the main wrapper?
(they work on other pages). Got me beat :|

http://newwave.co.nz/webshop/
(still in development)

17 Mar 2009, 8:47 AM
#19
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: What template to add additional divs outside of mainWrapper??

They are not losing transparency; they are letting the #mainWrapper bg color show through. You need to move the bg color to a div or divs inside the wrappers.```
/wrappers - page or section containers/

#mainWrapper { background-color: #ffffff; background-position: center 0; text-align: left; width: 920px; margin-right: 14px; margin-left: 14px; vertical-align: top; background-image: none; }

#mainWrapperLeft { background-image:url(http://www.newwave.co.nz/images/menusetc/newwavebgl.png); background-position: left top; background-repeat: repeat-y; margin: auto; padding-left:13px; }

#mainWrapperRight { background-image:url(http://www.newwave.co.nz/images/menusetc/newwavebgr.png); background-position: right top; background-repeat: repeat-y; padding-right:13px; }

17 Mar 2009, 8:36 PM
#20
emrico1 avatar

emrico1

New Zenner

Join Date:
Mar 2009
Posts:
55
Plugin Contributions:
0

Re: What template to add additional divs outside of mainWrapper??

Wow you have helped so much already.
I must have used twenty of your answers already (but only just started posting).

I'll give that a go.

I got the shadows to work but then the background image showed through the page.
So all I need to do is make a new div and give it the background colour! Of course. You sir, are a genius!

Thanks again... I'll let you know if it works