Jump to content

  • You cannot start a new topic
  • This topic is locked This topic is locked

Category Descriptions for Multicolumns Rate Topic   - - - - -

 
  • hostandname
  • Senior Member
  • Members
  • Join Date: 05-Jan 06
  • 196 posts

Posted 03 September 2010 - 02:16 PM #1

Anyone have any ideas how to correctly pass the Category Description to the following file:

/views/categories/components/categories_multicolumns.tpl

i currently modified this file with the following code which all works apart fromt he categories description

{foreach from=$categories item=category name="categories"}
    <div class="fatsoCategories">
        <h2><a href="{"categories.view?category_id=`$category.category_id`"|fn_url}" title="{$category.category}">{$category.category}</a></h2>
        <a href="{"categories.view?category_id=`$category.category_id`"|fn_url}" title="{$category.category}">{include file="common_templates/image.tpl" show_detailed_link=false object_type="category" images=$category.main_pair no_ids=true show_thumbnail="Y" image_width=$settings.Thumbnails.category_lists_thumbnail_width image_height=$settings.Thumbnails.category_lists_thumbnail_height}</a>
        {$category.description}
    </div>
{/foreach}

{capture name="mainbox_title"}{$title|default:$lang.categories}{/capture}

If anyone has any ideas, kindly let me know as i cannot seem to drag it in to the component

Host & Name Ltd - your reliable & trustworthy media provider (www.hostandname.co.uk)
Approved CS-Cart Developers and Official CS-Cart Licensing Supplier
Web Hosting | Cloud Hosting | Dedicated Servers | VPS | Domains | Emails | Design | Development | Marketing | Management


 
  • gginorio
  • Senior Member
  • Members
  • Join Date: 19-Oct 09
  • 333 posts

Posted 03 September 2010 - 07:26 PM #2

Anyone have any ideas how to correctly pass the Category Description to the following file:

/views/categories/components/categories_multicolumns.tpl

i currently modified this file with the following code which all works apart fromt he categories description

{foreach from=$categories item=category name="categories"}
    <div class="fatsoCategories">
        <h2><a href="{"categories.view?category_id=`$category.category_id`"|fn_url}" title="{$category.category}">{$category.category}</a></h2>
        <a href="{"categories.view?category_id=`$category.category_id`"|fn_url}" title="{$category.category}">{include file="common_templates/image.tpl" show_detailed_link=false object_type="category" images=$category.main_pair no_ids=true show_thumbnail="Y" image_width=$settings.Thumbnails.category_lists_thumbnail_width image_height=$settings.Thumbnails.category_lists_thumbnail_height}</a>
        {$category.description}
    </div>
{/foreach}

{capture name="mainbox_title"}{$title|default:$lang.categories}{/capture}

If anyone has any ideas, kindly let me know as i cannot seem to drag it in to the component


Here's a quick addon I made for free:
CS-Cart 2.0.13-2.1.0 Category Descriptions in Catalog Addon

Enjoy!

 
  • hostandname
  • Senior Member
  • Members
  • Join Date: 05-Jan 06
  • 196 posts

Posted 06 September 2010 - 10:17 PM #3

that is what i need yes but its built for categories list no? im currently using the block on the homepage for categories multicolumns...... is there anyway to apply it to this? i trie to base a addon using your code but not sure how you override the view components / view categories templates

Host & Name Ltd - your reliable & trustworthy media provider (www.hostandname.co.uk)
Approved CS-Cart Developers and Official CS-Cart Licensing Supplier
Web Hosting | Cloud Hosting | Dedicated Servers | VPS | Domains | Emails | Design | Development | Marketing | Management


 
  • gginorio
  • Senior Member
  • Members
  • Join Date: 19-Oct 09
  • 333 posts

Posted 07 September 2010 - 06:50 AM #4

Look at the addon. You'll see the location:

/var/skins_repository/base/customer/addons/category_descriptions/

Inside you see my template hooks directory:
/hooks/

And the hook I'm overriding is "categories:catalog"
/categories/catalog.override.tpl

So you'd need to find a hook in the template to override. Then add it to the "hooks" directory in the correct format. So if the hook is catalog:listing you want to create a catalog directory with a template in it for listing.override.tpl. That template should be a copy of the existing one with any changes you wish to make.

The descriptions, because of the addon, will still be available on the page.

 
  • vishywashi
  • Member
  • Members
  • Join Date: 14-Sep 10
  • 37 posts

Posted 16 December 2010 - 03:31 PM #5

i'm also looking for the similar solution
but the link isnt working
my home page have list of categories, i want description to appear along with it

 
  • remoteone
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 769 posts

Posted 13 June 2011 - 01:22 PM #6

The links been removed,
I need something similar.
Need to make my own custom Categories template for displaying Cats in the Cats Block.
I thought you could just create a new /views/categories/components/categories_multicolumns_xxx.tpl file from refer to it in a new /blocks/categories_multicolumns_xx.tpl file and give its a new
{** block-description:multicolumns_xxx **}

But I cant get the new template to show up in the "Apearance type." dropdown .

Wouldnt need hooks if creating an additional .tpl ??

 
  • remoteone
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 769 posts

Posted 14 June 2011 - 03:15 AM #7

Ok I intend starting a new topic more focused on
"How to create new Appearence Type and Wrapper templates"

We need to be able to create new Appearence Type and Wrapper templates for the Blocks, in particular, Categories Blocks.
The new Appearence Type and Wrapper templates MUST be selectable from within the Edit Block>> Appearence Type and Wrapper selection boxes.

Before I start this new topic, does anyone know of a guide or document relating to this. ??

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

Posted 14 June 2011 - 05:13 AM #8

You might go look at one of the last segments of the tutorial I wrote about creating an addon in the Developers section of the forum. I think it discusses where to add file for them to show in the Block contents. You can look at other blocks to see where appearance types are specified.

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.


 
  • remoteone
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 769 posts

Posted 18 June 2011 - 01:33 AM #9

You might go look at one of the last segments of the tutorial I wrote about creating an addon in the Developers section of the forum. .....

Thanks for that, I could not find your tute' but found this :
http://forum.cs-cart...9874#entry59874

Briefly, I created new Appearance type , using my example of categories_multicolumns_box.tpl
These are the files that need to be created or modified :
1. Create: //customer/blocks/categories_multicolumns_box.tpl
{** block-description:multicolumn_box **}
{include file="views/categories/components/categories_multicolumn_box.tpl"   ..........

2. Create: //views/categories/components/categories_multicolumn_box.tpl
This where the look of the Appearance type is described.

3.Add code (in the correct location of course) /Applications/MAMP/htdocs/3G/schemas/block_manager/structure.php
// add these lines  to make categories_multicolumns_box.tpl work
			'blocks/categories_multicolumns_box.tpl' => array (
				'params' => array (
					'get_images' => true
				)
			),
4.Add code (in the correct location of course) /Applications/MAMP/htdocs/3G/schemas/block_manager/specific_settings.php
// remoteONE mod to make categories_multicolumns_box.tpl work
		'blocks/categories_multicolumns_box.tpl' => array (
			'number_of_columns' =>  array (
				'type' => 'input',
				'default_value' => 2
			)
		),

5. Add language variable [multicolumn_box] to have the drop-down show a label "Multicolumn box" for the template rather than the template name.

That seems to be working,