Post by danbalbo » Thu Oct 14, 2010 12:11 am

Hey all,
i would like to hide selectively, on page basis, the right and/or left column. How can i achieve this in opencart 1.4.8 without modyfing the controller?
It would be also nice to add an ID or CLASS on the body tag for every page so to customize the layout of each page by css. is it possible?

Newbie

Posts

Joined
Wed Oct 13, 2010 11:58 pm

Post by JAY6390 » Thu Oct 14, 2010 6:44 am

To add a unique div based on the page, put

Code: Select all

<body id="<?php echo empty($this->request->get['route']) ? 'common-home' : str_replace('/', '-', empty($this->request->get['route'])); ?>">
This will give for example
product-category as the id for the product/category route,
common-home for either the default home page url or the route common/home
pretty self explanatory

then to hide the columns on that page, use css with the id and the column selector setting display:none

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by imaginetech » Thu Oct 14, 2010 9:18 am

Have a look at jquery, things like:-

$('.#column_right').hide()

Are quick ways to hide content whilst other methods allow you to resize div etc to get the layout you want.

Image
www.opencartstore.com
Get OpenCart Templates and OpenCart Modules.


User avatar
Active Member

Posts

Joined
Fri Sep 04, 2009 12:25 pm
Location - Darwin, Australia

Post by msblack7of9 » Fri Dec 24, 2010 9:00 am

Hi Jay6390, can you clarify your solution? I was able to get a body id for my homepage but not the rest of the pages. I used this coding you put:

<body id="<?php echo empty($this->request->get['route']) ? 'common-home' : str_replace('/', '-', empty($this->request->get['route'])); ?>">

I don't know what to add to this coding for the rest of the pages. Thanks!
7:)

Newbie

Posts

Joined
Sun Nov 28, 2010 2:04 am

Post by adriatiq » Tue Mar 15, 2011 7:07 am

<body class="<?php echo empty($this->request->get['route']) ? 'common-home' : str_replace('/', '-', $this->request->get['route']); ?>">

This works.

Newbie

Posts

Joined
Tue Mar 15, 2011 7:05 am

Post by msblack7of9 » Tue Mar 15, 2011 7:03 pm

ok thanks i'll try it.

Newbie

Posts

Joined
Sun Nov 28, 2010 2:04 am

Post by openmycart.com » Tue Mar 15, 2011 11:24 pm

Code: Select all

<body id="<?php echo empty($this->request->get['route']) ? 'common-home' : str_replace('/', '-', empty($this->request->get['route'])); ?>">
VS

Code: Select all

<body class="<?php echo empty($this->request->get['route']) ? 'common-home' : str_replace('/', '-', $this->request->get['route']); ?>">
???

Find and get many various of opencart modules, themes, mods, etc for your opencart store at http://www.openmycart.com/oc/, OPENCART SITE customization and Maintenance supports at here


User avatar
Active Member

Posts

Joined
Tue Oct 12, 2010 4:47 am

Who is online

Users browsing this forum: No registered users and 12 guests