Forums / Templates, Stylesheets, Page Layout / Want three columns on index page but two on all others

Want three columns on index page but two on all others

Locked

Started by dinki on 3 Nov 2006, 8:38 PM · Views: 3,023

Results 1 to 20 of 20
This thread is locked. New replies are disabled.
3 Nov 2006, 8:38 PM
#1
dinki avatar

dinki

Zen Follower

Join Date:
Oct 2006
Posts:
206
Plugin Contributions:
0

Want three columns on index page but two on all others

Hey guys, I'm making pretty good progress with my OSC to Zencart conversion. I am working on the index page and am running up against a formatting problem. The template that I am using is a two column template but on the index page I think I want to have the third (right) column.

Take a look at the page right now so you can get an idea of why I'd like the right column:

http://www.decaldepot.net/zencart/index.php

Right now, I am using an HTML table to generate the featured products as well as positioning the 'gift certificate' images. As you can guess, the positioning is dependent upon the text size. What I'd like to do is to hardcode the images in the right column so that they always appear where they should.

Can someone give me an idea on how to accomplish this? Do I need to override the main page?

Visit my Decal website: DecalDepot.net

3 Nov 2006, 9:29 PM
#2
westernstandard avatar

westernstandard

New Zenner

Join Date:
Aug 2006
Posts:
33
Plugin Contributions:
0

Re: Want three columns on index page but two on all others

I know that if you check the CSS readme inside the default template's CSS folder, it tells you how you can create a different stylesheet for different pages.

You can style your index page one way, and the rest in a different manner using the default stylesheet.

4 Nov 2006, 10:08 PM
#3
dinki avatar

dinki

Zen Follower

Join Date:
Oct 2006
Posts:
206
Plugin Contributions:
0

Re: Want three columns on index page but two on all others

Thank you for the reply. That was exactly what I needed to know! The templating/override system for Zencart is fantastic.

I am having on problem though. I tried naming my page dependent file as 'main_page.css' and 'index.css' but neither loaded as advertised. I changed the name to 'styleindex.css' and it loaded on the style* wildcard.

Can someone tell me the proper name for the css override for the index/main page?

Visit my Decal website: DecalDepot.net

9 Nov 2006, 5:25 PM
#4
dinki avatar

dinki

Zen Follower

Join Date:
Oct 2006
Posts:
206
Plugin Contributions:
0

Re: Want three columns on index page but two on all others

BUMP BUMP

Can someone please tell me what I need to name my css file so that it only loads for the main/home page??

Visit my Decal website: DecalDepot.net

10 Nov 2006, 6:27 PM
#5
westernstandard avatar

westernstandard

New Zenner

Join Date:
Aug 2006
Posts:
33
Plugin Contributions:
0

Re: Want three columns on index page but two on all others

I wish I could help, but I can't.

Have you checked the "docs" folder for any help files that might be in there to help you?

10 Nov 2006, 6:41 PM
#6
dinki avatar

dinki

Zen Follower

Join Date:
Oct 2006
Posts:
206
Plugin Contributions:
0

Re: Want three columns on index page but two on all others

According to the docs in the css directory, I should be able to just name this 'page_name.css' and it will load on the appropriate page. I've tried using 'index.css' and also 'main_page.css' but it doesn't load with either :(

Surely someone can tell me what I'm doing wrong!

Visit my Decal website: DecalDepot.net

10 Nov 2006, 6:53 PM
#7
igd avatar

igd

New Zenner

Join Date:
Nov 2004
Posts:
76
Plugin Contributions:
0

Re: Want three columns on index page but two on all others

shot in the dark but try index_default.css

Dan - statuscontrols.com/web
web programming and design

10 Nov 2006, 8:09 PM
#8
dinki avatar

dinki

Zen Follower

Join Date:
Oct 2006
Posts:
206
Plugin Contributions:
0

Re: Want three columns on index page but two on all others

Thanks for the tip, but that didn't work either. So the running list so far is:

index.css, main_page.css, and now index_default.css none of which work. I've named it style-main_page.css and it loads, but it loads on EVERY page! Hrmmmf.

Visit my Decal website: DecalDepot.net

12 Nov 2006, 3:27 AM
#9
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Want three columns on index page but two on all others

check your includes -> templates -> YOUR_TEMPLATE -> common -> tpl_main_page.php

right at the top of the page are instrucitons on how to do this.

This is the particular statement you could use:

// the following IF statement can be duplicated/modified as needed to set additional flags
  if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
    $flag_disable_right = true;
  }

You would list your pages replacing the highlighted portion.

you can get the page names by checking the url in your browser.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

12 Nov 2006, 4:34 AM
#10
dinki avatar

dinki

Zen Follower

Join Date:
Oct 2006
Posts:
206
Plugin Contributions:
0

Re: Want three columns on index page but two on all others

Thanks for the reply, however I can't see how this applies to loading a specific css file for the main_page?

Visit my Decal website: DecalDepot.net

12 Nov 2006, 4:53 AM
#11
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Want three columns on index page but two on all others

The name for the stylesheet for the index page is:

index_home.css

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

12 Nov 2006, 5:22 AM
#12
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Want three columns on index page but two on all others

The CSS files are sent to the browser in this order: (and alphabetically within each case of more than one match):

         style*.css   // are always loaded and at least ONE should contain site-wide properties.

language_stylesheet.css // changes to ALL pages, when that language is used
page_name.css // changes to one page
language_page_name.css // changes to one page, when that language is used
c_????.css // changes to all info pages in a category
language_c
????.css // changes to all info pages in a category, when that language is used
m
??.css // changes to a manufacturer's listing page
language_m_??.css // changes to a manufacturer's listing page, when that language is used
p_??.css // changes to a product's info page
language_p_??.css // changes to a product's info page, when that language is used
print*.css // printer-friendly global usage site-wide changes for printing-only
This is the basics and the bulk should be named stylesheet.css, then overrides in the others.

The full contents of this is in the readme in your css directory.

I am not sure that this will get you what you want and you will have to hard code a template switch in to the files as the physical layout is derived from the DB and not the css.

Css is for styling the physical elements that are present.

Zen-Venom Get Bitten

12 Nov 2006, 1:53 PM
#13
dinki avatar

dinki

Zen Follower

Join Date:
Oct 2006
Posts:
206
Plugin Contributions:
0

Re: Want three columns on index page but two on all others

clydejones:

The name for the stylesheet for the index page is:

index_home.css

Thanks Clyde. This fixed it. Can you tell me where you found where you found the proper name?

Visit my Decal website: DecalDepot.net

12 Nov 2006, 2:58 PM
#14
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Want three columns on index page but two on all others

There are a couple of threads in the "stylesheet" section as well as the "using the override system" section.

NOTE: We are sorry that Clyde is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

22 Feb 2007, 4:34 PM
#15
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Want three columns on index page but two on all others

Yes, this is an old thread, let me revive it with a question that pertains to this thread.

I am showing only categories on my index page, I am then only showing categories on the page that would follow if a user clicked on one of the categories from the index page. Iwould like to know how to have only two category columns on the index page and three category columns on the following page.

I have made an index_home.css and it does a great job at controlling the index only, Am I on the right track by using the css to accomplish this or am I way off?:huh:

Thanks,
Slabadoo

Slabadoo

22 Feb 2007, 4:58 PM
#16
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,846
Plugin Contributions:
0

Re: Want three columns on index page but two on all others

Place the following in includes/templates/YOUR_CUSTOM_TEMPLATE/common/tpl_main_page.php

if ($this_is_home_page) {
	  $flag_disable_right = true;
  }

This will disable the right column on the main page only

Mike
AEIIA - Zen Cart Certified & PCI Compliant Hosting
The Zen Cart Forum...Better than a monitor covered with post-it notes!

22 Feb 2007, 6:53 PM
#17
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Want three columns on index page but two on all others

Yes that would work but here is what i am trying to accomplish:

This is the index, read the text on the jpg

And

This is the page one would go to if they clicked on Bar Rails in the menu. Once again, there is text at the bottomof the image that has explanation

Hopefully this makes it more clear as to what I am trying to accomplish.

Thanks,
Slabadoo

Slabadoo

23 Feb 2007, 1:58 AM
#18
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,846
Plugin Contributions:
0

Re: Want three columns on index page but two on all others

oh ok.....
admin>configuration>layout settings>categories-always display on mainpage set to 1
Admin>configuration>maximum values>categories to list per row set to 2

You will then have to play in the stylesheet to get them to postion were you want as they will display side by side and take up 100% of the width available (50% each).

The second one requires you to install the column layout grid mod from the downloads section. Follow the instructions and it will add products listing - columns per row and Product Listing - Layout Style to admin>configuration>product listing

Mike
AEIIA - Zen Cart Certified & PCI Compliant Hosting
The Zen Cart Forum...Better than a monitor covered with post-it notes!

23 Feb 2007, 3:43 PM
#19
slabadoo avatar

slabadoo

Zen Follower

Join Date:
Jan 2007
Posts:
149
Plugin Contributions:
1

Re: Want three columns on index page but two on all others

Thanks for helping me out with this but for some reason, it just is not working for me, If i follow your directions, the categories don't even show up. I had already installed the mod you referenced and it got me closer but still, I am unable to get two categoriy columns on the index page and three sub-categories on the proceeding page you would be brought to if you clicked one of the links fom the index page. By the way what is >

admin>configuration>mainpage set to 1

I am assuming that that is in layout settings?

Any other thoughts?
Thanks again for all your help,
Slabadoo

Slabadoo

23 Feb 2007, 9:52 PM
#20
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,846
Plugin Contributions:
0

Re: Want three columns on index page but two on all others

admin>configuration>layout settings>categories-always display on mainpage set to 1

It means that setting that function to 1 (true) will make categories display on index page.

Mike
AEIIA - Zen Cart Certified & PCI Compliant Hosting
The Zen Cart Forum...Better than a monitor covered with post-it notes!