Forums / Templates, Stylesheets, Page Layout / Turn off right and left columns front page only

Turn off right and left columns front page only

Locked

Started by cshart on 27 Oct 2010, 5:08 AM · Views: 2,366

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
27 Oct 2010, 5:08 AM
#1
cshart avatar

cshart

Zen Follower

Join Date:
Mar 2005
Posts:
370
Plugin Contributions:
0

Turn off right and left columns front page only

How do you make a separate template for the frontpage that only has a center area, but yet have one or 2 columns on every other page?

Thanks,

C

27 Oct 2010, 5:17 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Turn off right and left columns front page only

Isn't this the same question you asked yesterday? http://www.zen-cart.com/forum/showthread.php?t=166857

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

27 Oct 2010, 5:20 AM
#3
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

Re: Turn off right and left columns front page only

If you're just wanting to hide the left and right columns on the Home Page ONLY, try adding this to your stylesheet.css:

#indexHomeBody #navColumnOne, #indexHomeBody #navColumnTwo {display: none;}

That will hide those two columns on the Home Page ONLY, and leave them to show on all the rest of your pages.

Teach them to shop and they will shop today;
Teach them to Zen and they will OWN a shop tomorrow!

27 Oct 2010, 4:18 PM
#4
cshart avatar

cshart

Zen Follower

Join Date:
Mar 2005
Posts:
370
Plugin Contributions:
0

Re: Turn off right and left columns front page only

Get Em Fast:

If you're just wanting to hide the left and right columns on the Home Page ONLY, try adding this to your stylesheet.css:

#indexHomeBody #navColumnOne, #indexHomeBody #navColumnTwo {display: none;}

> 
> That will hide those two columns on the Home Page ONLY, and leave them to show on all the rest of your pages.

To answer your question, no it is not really the same question because I need two separte templates one on the frontpage and one for the rest of the pages and did not know how to do that.

I hide the columns right and left and then I will have to expand the size of the center panel just for the front page.  will #indexCenterColumn {width: herenewpx; }or whatever that column is called take care of that problem?

Thank you for your help.

C
27 Oct 2010, 4:58 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Turn off right and left columns front page only

No, you don't need two separate templates. If you hide or turn off the sidebars using either the suggested method or the method described in tpl_main_page.php, the center column will expand to fill the space they occupied.

If you have a bunch of styling you want different for the homepage, you can create a stylesheet named index_home.css with all the rules that apply only to the homepage.

23 Dec 2010, 6:39 AM
#6
goldenis avatar

goldenis

Zen Follower

Join Date:
Nov 2010
Posts:
115
Plugin Contributions:
0

Re: Turn off right and left columns front page only

Have inserted the index statement several different places in the style sheet with no result. Last location shown below. Does it matter where it is inserted? Classic 1.3.9h Thank You!

#navColumnOne, #navColumnTwo {
background-color: transparent;
}

#indexHomeBody #navColumnOne, #indexHomeBody #navColumnTwo {display: none;}

23 Dec 2010, 6:45 AM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Turn off right and left columns front page only

If there is another rule for #navColumnOne after your new rule, any display: xxx; setting in that will override the new one. Try putting your new rule at the end of the stylesheet.

24 Dec 2010, 3:19 AM
#8
goldenis avatar

goldenis

Zen Follower

Join Date:
Nov 2010
Posts:
115
Plugin Contributions:
0

Re: Turn off right and left columns front page only

That part seems to be working, but now I see turning off columns on the category pages is needed also. Do I just add text to the previous change?

Thanks!

1.3.9h http: //www.naicsfurniture.com

PS I know there are other problems. Trying to work through them one at a time.

24 Dec 2010, 3:24 AM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: Turn off right and left columns front page only

That won't work with just stylesheet rules, because there are several kinds of pages with a body id of #indexBody. You need to set flags in /includes/templates/your_template/common/tpl_main_page.php, as described in the comments at the top of that file.