Jump to content

Section Wrappers


Majjy

Recommended Posts

The section wrappers apply style to that named section. What we need to do is to apply display logic (not styling*) to the right column.

 

CubeCart gives to the template engine a value for the variable $SECTION_NAME. You can see a <div> with an id that comprises the $SECTION_NAME along with "_wrapper" to form a complete id of, for example, product_wrapper, or category_wrapper. An almost complete list can be seen in the skin's common.css file so that you can apply specific stylings to this div depending on what it is showing.

Also, using $SECTION_NAME, you can create a test, for example:

{if in_array($SECTION_NAME,array('product','category'))}
html stuff
{/if}

So, for your particular solution:

 {if !in_array($SECTION_NAME,array('checkout','gateway'))}
      <div class="sidebar" id="sidebar_right">
        {$SHOPPING_CART}
        {$RANDOM_PROD}
        {if isset($POPULAR_PRODUCTS)}{$POPULAR_PRODUCTS}{/if}
      </div>
{/if}

Unfortunately, most stock CubeCart skins are fixed-width everything. So, if the right column disappears, you may end up with an empty space because the center column could be a fixed-width.

 

* We can also use this test to include a brief style attribute to the div.

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...