Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Ecommerce page layout problem - 2 sidebars


Go to End


5 Posts   1216 Views

Avatar
Pixel

Community Member, 78 Posts

8 July 2008 at 12:22am

Edited: 08/07/2008 12:25am

Hi. I have been using the ecommerce module for the first time and was using a two column site layout in which the ecommerce module sat on the left with its sidebar and then the general Page sidebar used throughout the site for second and third tier navigation sat on the right with an advert below.
However the clients have now decided that they want a 3 column design with the general navigation on the left, then content and then the advert on the right. But by doing this the ecommerce pages now have 2 sidebars on the left - which isn't wanted.
Does anybody know how i can remove the general Page sidebar?
I can quite happily create new templates for pages that require a different layout such as the home page but how would i do this for a module?

Please view the attachment

Thanks in advance

Avatar
Willr

Forum Moderator, 5523 Posts

8 July 2008 at 12:48pm

Does anybody know how i can remove the general Page sidebar?

You would just need to tweak the Page.ss file in your theme, Depends on what theme you are using as a base - the sidebar might be included via a <% include Sidebar %> or something like that.

Avatar
Pixel

Community Member, 78 Posts

8 July 2008 at 8:14pm

It is only the ecommerce pages in which i wish to drop the sidebar but because it is a module i am not sure how to do this.
Would i need to create a new template in which the ecommerce module pages would extend from?
I am using Blackcandy as my base.

Avatar
Willr

Forum Moderator, 5523 Posts

8 July 2008 at 9:06pm

Dont know if theres a easy way to do this but you may need to create a template file in blackcandy/templates/Layout/ for each of the page types? Eg for the Products page you would need a Product.ss file which doesnt have a <% include Sidebar %>.. etc etc for each page type. Or you could wrap a if round the <% include Sidebar %> which checks for ecommerce page types eg

<% if ClassName = Product %>
<% else %>
 <% if ClassName = ProductGroup %>
 <% else %>
   <% include Sidebar %>
<% end_if %>
<% end_if %>

Its pretty ugly as you have to check for each page type...

Avatar
Pixel

Community Member, 78 Posts

8 July 2008 at 10:15pm

Edited: 08/07/2008 10:17pm

The if wrap seems to be a good solution. Just need to play with the ecommerce CSS a little bit.

Thanks for the help