Forums / Templates, Stylesheets, Page Layout / Change layout of Categories Pages

Change layout of Categories Pages

Locked

Started by graphic_content on 28 May 2010, 1:41 PM · Views: 802

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
28 May 2010, 1:41 PM
#1
graphic_content avatar

graphic_content

New Zenner

Join Date:
Nov 2008
Location:
Gex, France
Posts:
71
Plugin Contributions:
0

Change layout of Categories Pages

Hi there,

The site that I am working on currently has swapping images as the background of the #contentMainWrapper on page reload.

This is fine for the homepage however when I click through to the categories listing page these images still appear, obviously this is because the categories page uses the index page for its layout.

Is there a way to load the categories pages through a different page for example a static page?

This would solve my problem as I want a customised sidebar to also appear on these pages but not on the index page.

I hope this makes sense?

Thanks
Matt

Matt Martin
Graphic Content (UK)
www.graphiccontent.co.uk

28 May 2010, 2:25 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Change layout of Categories Pages

How is this whole process being driven, currently? Through code modifications, or JS, or CSS ... ?

20 years a Zencart User

28 May 2010, 2:34 PM
#3
graphic_content avatar

graphic_content

New Zenner

Join Date:
Nov 2008
Location:
Gex, France
Posts:
71
Plugin Contributions:
0

Re: Change layout of Categories Pages

At the moment I am using JS <body onload="swapPic()"> to change the homepage images.

I am then using the 'Smart Background' mod to change addition page backgrounds.

I have sidebars turned off globally and have created my own sidebar div in the product_info_display.php file which pulls in the category menu.

I want this category menu to appear on the category / sub category pages with a plain white #contentMainWrapper.

So to achieve this I think I need to load the tpl_index_categories.php file into something other than the index page.

If I could pull it in using a duplicate of the index page called index1 for example that would solve my issue.

Thanks

Matt Martin
Graphic Content (UK)
www.graphiccontent.co.uk

28 May 2010, 2:39 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Change layout of Categories Pages

A long shot... but have you tried page-specific (or category-specific) stylesheets that force a declaration using !important ... ?

20 years a Zencart User

28 May 2010, 2:50 PM
#5
graphic_content avatar

graphic_content

New Zenner

Join Date:
Nov 2008
Location:
Gex, France
Posts:
71
Plugin Contributions:
0

Re: Change layout of Categories Pages

I will give it a go, Do you know where in the code it tells the links for the category pages to go through /index.php?main_page=index&cPath=

If I could find this perhaps I could tell it to go elsewhere?

Matt Martin
Graphic Content (UK)
www.graphiccontent.co.uk

28 May 2010, 2:56 PM
#6
graphic_content avatar

graphic_content

New Zenner

Join Date:
Nov 2008
Location:
Gex, France
Posts:
71
Plugin Contributions:
0

Re: Change layout of Categories Pages

ok cool I have used a category specific stylesheet using the !important term and can now add the correct background.

To get around the sidebar, perhaps I'll add it in the tpl_main_page and see to display:none in the default stylesheet.

Bit of a dirty way but hey! sometimes you gotta do it dirty to get it right!

Matt Martin
Graphic Content (UK)
www.graphiccontent.co.uk

5 Aug 2010, 1:41 PM
#7
zenhomeboy avatar

zenhomeboy

New Zenner

Join Date:
Jul 2010
Posts:
20
Plugin Contributions:
0

Re: Change layout of Categories Pages

GREETz

I wonder if s/o would explain the solution you found. I need a different background image for each of my category pages (and other specifics per category) and was looking at that code ```
main_page=index


So then the question of category-specific stylesheet comes up. How do I implement that? 

In fact I feel I am missing a whole elegant solution re: category-specific templating to begin with. Isn't there a way to create directories named after my categories to contain their specific directives?

or is that nepalese temple hash from back in '72 finally kicking in after scouring this awesome forum and getting lost in copious notes?


ADVthanxANCE

the zen Homeboy

My Karma Ran Over My Dogma

6 Aug 2010, 4:05 AM
#8
zenhomeboy avatar

zenhomeboy

New Zenner

Join Date:
Jul 2010
Posts:
20
Plugin Contributions:
0

Re: Change layout of Categories Pages

Greetings all

using 1.3.9d - new install, no mods added

I am finding i need some help in navigating the structure and logic here in ZC. I have a single column design that needs to be "zennified"
and I have the main page pretty much conforming to the spec I have been given. It calls for unique background images for each subsequent
category page and each of them simply calls for a grid of photos and descriptions, etc. of their respective products. to set each of their
bg-images i need access to including the #mainWrapper directive per category page. The posts I read and searches on the forum I make, seem
to take me down many varying paths, some of which I can hardly follow and those I can bring me 'nojoy'. My ideal solution will keep me
as close to the ZC-way as is possible. and I know ZC has the flexibility... I'm maybe just too new and not well-enough versed yet.

Q1. What is the voodoo that involves creation of the appropriate directories corresponding to the category names where their respective
templates live? If there is such a voodoo? In other words can ZC look info my includes/templates/my_template_name/templates/ and upon
finding directory names matching my categories proeed along that path for its override files?

Q2. the construct "Loaded by main_page=index?cPathx" which appears in the comments of several of the template files - is set where?
I looked in tpl_main_page.php but it's not clear to me which cPath belongs to what. Or is this another red herring?

Q3. how to isolate my css so its page or category-specific?

I'm either trapped as a prisoner in a fortune cookie factory, or
truly
eyeless in gaza.

AdVthanxANCE to all the helpful folks on this forum.

the zen Homeboy

My Karma Ran Over My Dogma