Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Different home page layout PLEASE HELP! Rate Topic   - - - - -

 
  • geeves
  • Junior Member
  • Members
  • Join Date: 10-Dec 09
  • 16 posts

Posted 29 March 2010 - 12:43 PM #1

Hi guys.

I'm trying to configure my template so that the home page content area has a specific class applied so I can display content without any padding.

How can I target the home page specifically with smarty so as to display two different versions of the 'central-column' div (in <my_skin>/customer/main.tpl).

<div class="central-column">
	<div class="central-content{if home page} home-page{/if}">
		{include file="common_templates/breadcrumbs.tpl"}
		{include file="`$location_dir`/central.tpl"}
	</div>
</div>

I'm trying to add a class to the central content div to differentiate it for the home page: eg.
{if home page} home-page{/if}

If anyone can PLEASE help, I would greatly appreciate it.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11934 posts

Posted 05 April 2010 - 07:58 AM #2

The following free local addon (http://www.ez-ms.com...ocal-addon.html) will allow you to use "controller specific" css files. Hence you can load one css file when the index page loads and a different one when the checkout page loads. This will alllow you to use different style definitions depending on the "context" (controller) being used.

css files are kept in skins/<your_skin>/customer/addons/local/css directory and are named like index.css, checkout.css, categories.css, etc.

Note that if you enable this option you should install an empty file for every controller otherwise you'll get a noisy error_log about "file not found".

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • OknooRap
  • Junior Member
  • Members
  • Join Date: 20-Jan 10
  • 1 posts

Posted 04 June 2010 - 08:18 AM #3

Hey you could use this syntax

{if $mode == 'index'}
blablabla
{else}
blablabla
{/if}

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11934 posts

Posted 04 June 2010 - 05:37 PM #4

Hey you could use this syntax

{if $mode == 'index'}
blablabla
{else}
blablabla
{/if}


Not in a CSS file which is what I understood he wanted to be specific to the controller.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • plinkplink
  • Member
  • Members
  • Join Date: 25-Apr 10
  • 156 posts

Posted 28 June 2010 - 01:53 AM #5

The following free local addon (http://www.ez-ms.com...ocal-addon.html) will allow you to use "controller specific" css files. Hence you can load one css file when the index page loads and a different one when the checkout page loads. This will alllow you to use different style definitions depending on the "context" (controller) being used.

css files are kept in skins/<your_skin>/customer/addons/local/css directory and are named like index.css, checkout.css, categories.css, etc.

Note that if you enable this option you should install an empty file for every controller otherwise you'll get a noisy error_log about "file not found".


This is interesting. So you just place the downloaded files in the right folders, install the addon, make new css files in skins/<your_skin>/customer/addons/local/css directory... and then what? Do you have to write in hooks to the tpl files? I've had limited success with that in the past. I'd love a quick explanation of how this works if you have a minute.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11934 posts

Posted 28 June 2010 - 05:23 AM #6

To be specific...
1) unarchive the archive in the root directory of your store. All files are then in the right places.
2) Install the addon from Administration/Addons in the admin panel
3) Click "edit' for "Local Configuration" and the check the checkbox that say "Use controller specific CSS files" and click Save.
4) Create/edit you css files. They will be loaded automatically from the single "post hook" in skins/<your_skin>/customer/addons/local/hooks/index/styles.post.tpl.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • plinkplink
  • Member
  • Members
  • Join Date: 25-Apr 10
  • 156 posts

Posted 29 June 2010 - 03:47 AM #7

Excellent. Thanks for the heads-up. I'll give it another try and see if I can wrap my brain around it.