Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.

Dynamic Sidebars

Started by pricediscrimination on 5 Jun 2012, 1:53 AM · Views: 1,151

Results 1 to 12 of 12
5 Jun 2012, 1:53 AM
#1
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Post #1 by pricediscrimination

Hi is there a way to make the sidebars more dynamic like a wordpress site? Or, is this feature built into any of the newer themes?

5 Jun 2012, 9:38 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Post #2 by stevesh

Not sure exactly what you mean by 'dynamic'.

5 Jun 2012, 7:11 PM
#3
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Post #3 by pricediscrimination

Hi, I mean that you can create different style of sidebars depending on the page the visitor is on. For example, some pages might not even need a side bar such as the shopping cart, etc.

5 Jun 2012, 7:41 PM
#5
schoolboy avatar

schoolboy

Totally Zenned

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

Post #5 by schoolboy

Yes... all of this is possible, though not in the same way that WordPress does it. There are a number of techniques, and indeed "combinations" of techniques, which include:

  1. Stylesheets (page-specific)
  2. Edits to tpl_main_page.php
  3. Settings in layout controllers ( including EZPages, where you can disable columns based on EZPage ID numbers).

20 years a Zencart User

6 Jun 2012, 10:52 PM
#8
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Post #8 by pricediscrimination

schoolboy:

Yes... all of this is possible, though not in the same way that WordPress does it. There are a number of techniques, and indeed "combinations" of techniques, which include:

  1. Stylesheets (page-specific)
  2. Edits to tpl_main_page.php
  3. Settings in layout controllers ( including EZPages, where you can disable columns based on EZPage ID numbers).

Thanks! Is your #3 something to do with the option to turn on and off the center column status in the layout boxes controller? It never works for some reason.

6 Jun 2012, 10:52 PM
#9
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Post #9 by pricediscrimination

gjh42:

You can also edit specific sideboxes' module files to control when they will display, if you want that level of granularity.

How about to get rid of the sidebar entirely on the checkout page to make that page full width for example?

7 Jun 2012, 3:50 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

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

Post #10 by schoolboy

pricediscrimination:

Thanks! Is your #3 something to do with the option to turn on and off the center column status in the layout boxes controller? It never works for some reason.

No... column control is best-managed by:

  1. edits to tpl_main_page.php (where you can disable left/right columns for specific pages)...
// 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;
  }

EG

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

There are comprehensive NOTES in tpl_main_page.php for column display customisation

  1. Page/category specific stylesheets (SEE THE README file in /includes/templates/classic/css/CSS_read_me.txt

Using {display:none} declarations for either the whole column, or even certain sideboxes in a column, you can hide elements on specific pages/categories...

  1. For EZPAGES, see ADMIN>>>CONFIGURATION>>>EZ PAGES SETTINGS...
    EZ-Pages Pages to disable headers
    EZ-Pages Pages to disable footers
    EZ-Pages Pages to disable left-column
    EZ-Pages Pages to disable right-column

20 years a Zencart User

7 Jun 2012, 5:36 PM
#11
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Post #11 by pricediscrimination

schoolboy:

No... column control is best-managed by:

  1. edits to tpl_main_page.php (where you can disable left/right columns for specific pages)...

// 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;
}

> 
> EG
> 
> ```php
// the following IF statement can be duplicated/modified as needed to set additional flags
  if  (in_array($current_page_base,explode(",",'shopping_cart'))  ) {
    $flag_disable_right = true;
  }

There are comprehensive NOTES in tpl_main_page.php for column display customisation

Tried this one so far, and it works flawlessly! Thank you so much. I'll explore the other options too.

7 Jun 2012, 6:23 PM
#12
pricediscrimination avatar

pricediscrimination

Zen Follower

Join Date:
May 2008
Posts:
401
Plugin Contributions:
0

Post #12 by pricediscrimination

When you empty the cart, it carries over the missing sidebar, is there a way to put the sidebar back in in a situation like this?