Cataloger item attributes in category template
Cataloger item attributes in category template
I need to access some of the item attributes of cataloger in my category template. How is this done?
Right now, all attributes that work are:
"$items array contents:
$items[].title, $items[].link, $items[].image, $items[].attrname"
The "$items[].attrname" suggests I should write any item attribute name here, but nothing works. I tried with "weight" and "price" both of which are attributes in the items. Is there some special syntax for these or are they just not accessible from the category template?
Has anyone made this work?
I have a category page where all the items are listed, but right now they only have the titles. I would like the to also show some more info.
Carl
Right now, all attributes that work are:
"$items array contents:
$items[].title, $items[].link, $items[].image, $items[].attrname"
The "$items[].attrname" suggests I should write any item attribute name here, but nothing works. I tried with "weight" and "price" both of which are attributes in the items. Is there some special syntax for these or are they just not accessible from the category template?
Has anyone made this work?
I have a category page where all the items are listed, but right now they only have the titles. I would like the to also show some more info.
Carl
Re: Cataloger item attributes in category template
Take a look at
http://forum.cmsmadesimple.org/index.php/topic,27721.0.html
I have some other issue with using lightbox with cataloger, but my code should help you.
To be more specific, you have to adopt Category-CSS-based template. So, to call 'weight' item attribute, you should add this to your category page template:
{$items[numloop].weight}
Style 'weight' class through css.. this code should work without problems at all
Darko
http://forum.cmsmadesimple.org/index.php/topic,27721.0.html
I have some other issue with using lightbox with cataloger, but my code should help you.
To be more specific, you have to adopt Category-CSS-based template. So, to call 'weight' item attribute, you should add this to your category page template:
{$items[numloop].weight}
Style 'weight' class through css.. this code should work without problems at all

Darko
Re: Cataloger item attributes in category template
Take a look at
http://forum.cmsmadesimple.org/index.php/topic,27721.0.html
I have some other issue with using lightbox with cataloger, but my code should help you.
To be more specific, you have to adopt Category-CSS-based template. So, to call 'weight' item attribute, you should add this to your category page template:
{$items[numloop].weight}
Style 'weight' class through css.. this code should work without problems at all...
Darko
http://forum.cmsmadesimple.org/index.php/topic,27721.0.html
I have some other issue with using lightbox with cataloger, but my code should help you.
To be more specific, you have to adopt Category-CSS-based template. So, to call 'weight' item attribute, you should add this to your category page template:
{$items[numloop].weight}
Style 'weight' class through css.. this code should work without problems at all...
Darko
Last edited by darconny on Sat Nov 22, 2008 9:24 pm, edited 1 time in total.
Re: Cataloger item attributes in category template
Thanks for answering,
I'm already using the Category-CSS-based template but I still can't make it work.
My Template looks like this at the moment:
However the category page still only shows the image thumbnail and the item title, no weight. Is is something to do with my MLE patch? I have the cataloger MLE patch, but do I need something else as well?
Are the attributes called something else in MLE?
Just thinking out loud, hopefully someone can hear me...
I'm already using the Category-CSS-based template but I still can't make it work.
My Template looks like this at the moment:
Code: Select all
<h3>{$title}</h3>
{section name=numimg loop=$image_url_array}<img src="{$image_url_array[numimg]}" />{/section}
{$notes}
<div class="category_items">
{if $hasnav == 1}
<div class="catnav">{$prev}{$navstr}{$next}</div>
{/if}
{counter start=0 print=false}
{section name=numloop loop=$items}
<div class="category_item"><span class="catnum">{counter print=true}.</span><a href="{$items[numloop].link}"><img src="{$items[numloop].image}" alt="{$items[numloop].title}"/></a><a href="{$items[numloop].link}">{$items[numloop].title}</a>
<br>
{$items[numloop].weight}
</div>
{/section}
{if $hasnav == 1}
<div class="catnav">{$prev}{$navstr}{$next}</div>
{/if}
</div>
Are the attributes called something else in MLE?
Just thinking out loud, hopefully someone can hear me...
Re: Cataloger item attributes in category template
this is what the source of the page looks like:
No sign of the weight attribute even loading there! What is missing?
Code: Select all
<div class="category_item"><span class="catnum">1.</span><a href="http://www.milmac.se/index.php?page=hagglunds-206a-mt&hl=swe"><img src="http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=hagglunds-206a-mt_s_1_70_0.jpg&ac=31082" alt="Hägglunds 206A MT"/></a><a href="http://www.milmac.se/index.php?page=hagglunds-206a-mt&hl=swe">Hägglunds 206A MT</a>
<br>
</div>
<div class="category_item"><span class="catnum">2.</span><a href="http://www.milmac.se/index.php?page=hagglunds-bv206-softtop&hl=swe"><img src="http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=hagglunds-bv206-softtop_s_1_70_0.jpg&ac=03316" alt="Hägglunds BV206 Softtop"/></a><a href="http://www.milmac.se/index.php?page=hagglunds-bv206-softtop&hl=swe">Hägglunds BV206 Softtop</a>
<br>
</div>
Re: Cataloger item attributes in category template
Have you tried to add {$items|print_r} in your template?
If not? do that and you will see what variables that are available
/Coldman
If not? do that and you will see what variables that are available
/Coldman
Important Code of Conduct
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
Re: Cataloger item attributes in category template
I am not sure if this can solve your problem, but try to apply hematec patch:
http://forum.cmsmadesimple.org/index.php/topic,23263.0.html

http://forum.cmsmadesimple.org/index.php/topic,23263.0.html

Re: Cataloger item attributes in category template
Hey guys thanks alot for trying to help me, I patched the cataloger.module.php with the hematec patch mentioned, but it made no difference at all. strange.
I also tried adding the {$items|print_r}, and this is the result:
The other attributes don't seem to get picked up!
I also tried adding the {$items|print_r}, and this is the result:
Code: Select all
Array ( [image] => http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=hagglunds-206a-mt_s_1_70_0.jpg&ac=94552 [image_src] => http://www.milmac.se/uploads/images/catalog_src/hagglunds-206a-mt_src_1.jpg [link] => http://www.milmac.se/index.php?page=hagglunds-206a-mt&hl=usa [title] => Hagglunds 206A MT [menutitle] => Hagglunds 206A MT [modifieddate] => 2008-10-28 11:58:25 [category] => [cat] => [createdate] => 2008-09-21 23:54:06 [type] => catalogitem [0] => ) Array ( [image] => http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=hagglunds-bv206-softtop_s_1_70_0.jpg&ac=56388 [image_src] => http://www.milmac.se/uploads/images/catalog_src/hagglunds-bv206-softtop_src_1.jpg [link] => http://www.milmac.se/index.php?page=hagglunds-bv206-softtop&hl=usa [title] => Hagglunds BV206 Softtop [menutitle] => Hagglunds BV206 Softtop [modifieddate] => 2008-10-28 11:59:22 [category] => [cat] => [createdate] => 2008-10-08 09:39:51 [type] => catalogitem [0] => ) Array ( [image] => http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=hagglunds-bv206-personell-carrier_s_1_70_0.jpg&ac=06661 [image_src] => http://www.milmac.se/uploads/images/catalog_src/hagglunds-bv206-personell-carrier_src_1.jpg [link] => http://www.milmac.se/index.php?page=hagglunds-bv206-personell-carrier&hl=usa [title] => Hagglunds BV206 Personell Carrier [menutitle] => Hagglunds BV206 Personell Carrier [modifieddate] => 2008-10-28 12:46:00 [category] => [cat] => [createdate] => 2008-10-08 16:36:53 [type] => catalogitem [0] => ) Array ( [image] => http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=volvo-21-6x6-troop-transport_s_1_70_0.jpg&ac=54056 [image_src] => http://www.milmac.se/uploads/images/catalog_src/volvo-21-6x6-troop-transport_src_1.jpg [link] => http://www.milmac.se/index.php?page=volvo-21-6x6-troop-transport&hl=usa [title] => Volvo 21 6x6 Troop transport [menutitle] => Volvo 21 6x6 Troop transport [modifieddate] => 2008-10-28 12:01:31 [category] => [cat] => [createdate] => 2008-10-08 16:40:27 [type] => catalogitem [0] => ) Array ( [image] => http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=trailer-personell-carrier_s_1_70_0.jpg&ac=49389 [image_src] => http://www.milmac.se/uploads/images/catalog_src/trailer-personell-carrier_src_1.jpg [link] => http://www.milmac.se/index.php?page=trailer-personell-carrier&hl=usa [title] => Trailer Personell Carrier [menutitle] => Trailer Personell Carrier [modifieddate] => 2008-10-28 12:46:37 [category] => [cat] => [createdate] => 2008-10-08 16:53:03 [type] => catalogitem [0] => ) Array ( [image] => http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=trailer-workshop_s_1_70_0.jpg&ac=43558 [image_src] => http://www.milmac.se/uploads/images/catalog_src/trailer-workshop_src_1.jpg [link] => http://www.milmac.se/index.php?page=trailer-workshop&hl=usa [title] => Trailer Workshop [menutitle] => Trailer Workshop [modifieddate] => 2008-10-28 12:47:01 [category] => [cat] => [createdate] => 2008-10-27 11:25:55 [type] => catalogitem [0] => ) Array ( [image] => http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=gmc-top-kick-v8-cat_s_1_70_0.jpg&ac=74330 [image_src] => http://www.milmac.se/uploads/images/catalog_src/gmc-top-kick-v8-cat_src_1.jpg [link] => http://www.milmac.se/index.php?page=gmc-top-kick-v8-cat&hl=usa [title] => GMC Top kick V8 cat [menutitle] => GMC Top kick V8 cat [modifieddate] => 2008-10-28 12:42:18 [category] => [cat] => [createdate] => 2008-10-27 11:55:15 [type] => catalogitem [0] => ) Array ( [image] => http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=uaz-4x4_s_1_70_0.jpg&ac=59788 [image_src] => http://www.milmac.se/uploads/images/catalog_src/uaz-4x4_src_1.jpg [link] => http://www.milmac.se/index.php?page=uaz-4x4&hl=usa [title] => Uaz 4x4 [menutitle] => Uaz 4x4 [modifieddate] => 2008-10-28 12:49:09 [category] => [cat] => [createdate] => 2008-10-27 12:00:45 [type] => catalogitem [0] => ) Array ( [image] => http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=scania-30-car_s_1_70_0.jpg&ac=59425 [image_src] => http://www.milmac.se/uploads/images/catalog_src/scania-30-car_src_1.jpg [link] => http://www.milmac.se/index.php?page=scania-30-car&hl=usa [title] => Scania 30 car [menutitle] => Scania 30 car [modifieddate] => 2008-10-28 12:55:33 [category] => [cat] => [createdate] => 2008-10-28 12:50:55 [type] => catalogitem [0] => ) Array
Re: Cataloger item attributes in category template
Yes, very strange. I think that a good start would be to reset category template to default, and just add one item attribute.
Something like this:
{$title}
{section name=numimg loop=$image_url_array}{/section}
{$notes}
{if $hasnav == 1}
{$prev}{$navstr}{$next}
{/if}
{section name=numloop loop=$items}
{$items[numloop].title}
{$items[numloop].weight}
{/section}
{if $hasnav == 1}
{$prev}{$navstr}{$next}
{/if}
This works for me, after applying Alby cataloger mle and hematec patch.
Something like this:
{$title}
{section name=numimg loop=$image_url_array}{/section}
{$notes}
{if $hasnav == 1}
{$prev}{$navstr}{$next}
{/if}
{section name=numloop loop=$items}
{$items[numloop].title}
{$items[numloop].weight}
{/section}
{if $hasnav == 1}
{$prev}{$navstr}{$next}
{/if}
This works for me, after applying Alby cataloger mle and hematec patch.
Re: Cataloger item attributes in category template
I made a new category template with your exact code, and changed the page to it, this is the source of the result:'
Nothing! I can't believe this. I also have the alby Cataloger-0.7 MLE Patch and now the hematec too, but it still won't work for me!
Crazy...
Code: Select all
<h1>Vehicles</h1>
<img src="http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=vehicles_cf_1_400_0.jpg&ac=42486" alt="Vehicles" title="Vehicles" />
<div class="category_items">
<div class="category_item"><a href="http://www.milmac.se/index.php?page=hagglunds-206a-mt&hl=usa"><img src="http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=hagglunds-206a-mt_s_1_70_0.jpg&ac=26254" title="Hagglunds 206A MT" alt="Hagglunds 206A MT"/></a><br /><a href="http://www.milmac.se/index.php?page=hagglunds-206a-mt&hl=usa">Hagglunds 206A MT</a>
</div>
<div class="category_item"><a href="http://www.milmac.se/index.php?page=hagglunds-bv206-softtop&hl=usa"><img src="http://www.milmac.se/modules/Cataloger/Cataloger.Image.php?i=hagglunds-bv206-softtop_s_1_70_0.jpg&ac=10000" title="Hagglunds BV206 Softtop" alt="Hagglunds BV206 Softtop"/></a><br /><a href="http://www.milmac.se/index.php?page=hagglunds-bv206-softtop&hl=usa">Hagglunds BV206 Softtop</a>
</div>
Crazy...
Re: Cataloger item attributes in category template
And you are sure that you have added Weight in Cataloger -> Manage User-Defined Attributes -> Item Attributes ?
Important Code of Conduct
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
Re: Cataloger item attributes in category template
I think so. I mean, it's there and I use it for the item page where everything works fine. I just can't get the category template to access the variables, other than images, link, and title. And from the "print_r" command I noticed "menutitle" as well. None of my user defined attributes are there.

