I'm trying to do something that I think should be simple but it's obviously over my head as I haven't been able to figure it out. What I'd like is to do is add the following to the left sidebar of my category pages:
1) The category image
2) The category title
3) The category summary
It would be really nice if this were a seperate file in my Conlib folder so I could simply include a line in the sidebar scriptlet like [[Conlib:categoryinfo]]
Can anyone help me out?
Dan
<><
Category image, title & summary in sidebar
Re: Category image, title & summary in sidebar
You can do something like this on category page scriptlets1) The category image
Code: Select all
#if ($Category.ThumbnailUrl.Substring(0,2) == "~/")
<img src='$Store.StoreUrl/$Category.ThumbnailUrl.Substring(2)' border="0" />
#else
<img src='${Store.StoreUrl}${Category.ThumbnailUrl}' border="0" />
#end
2) The category title
Code: Select all
$Category.Name
3) The category summary
Code: Select all
$Category.Summary
viewtopic.php?f=47&t=14818
- GrfxDan
- Lieutenant Commander (LCDR)
- Posts: 82
- Joined: Sat May 26, 2007 10:58 am
- Location: Mt Zion, IL
- Contact:
Re: Category image, title & summary in sidebar
Mazhar, thanks so much! That's what I needed.
One more question: Is there a way, using the scriptlet code above to display the category thumbnail, to modify the thumbnail filename?
I have 2 versions of my category thumbnails, the default thumbnail image (120px square) and a larger version (160px square). The default 120px version is the one used by AbleCommerce, and is what's returned using the code you provided. My larger version has an _l appended to the filename and is the one that I actually want displayed in the sidebar. Example: thunbmail.jpg is the 120px version and thumbnail_l.jpg is the 160px version. I've previously figured out how to insert the "_l" in the filename when working with an .ascx file but I have no idea how to do this in a scriplet, if it's even possible. Is it?
Thanks again!
One more question: Is there a way, using the scriptlet code above to display the category thumbnail, to modify the thumbnail filename?
I have 2 versions of my category thumbnails, the default thumbnail image (120px square) and a larger version (160px square). The default 120px version is the one used by AbleCommerce, and is what's returned using the code you provided. My larger version has an _l appended to the filename and is the one that I actually want displayed in the sidebar. Example: thunbmail.jpg is the 120px version and thumbnail_l.jpg is the 160px version. I've previously figured out how to insert the "_l" in the filename when working with an .ascx file but I have no idea how to do this in a scriplet, if it's even possible. Is it?
Thanks again!
- GrfxDan
- Lieutenant Commander (LCDR)
- Posts: 82
- Joined: Sat May 26, 2007 10:58 am
- Location: Mt Zion, IL
- Contact:
Re: Category image, title & summary in sidebar
Another thought too: I had no idea that adding the category name and summary would be as simple as $Category.Name and $Category.Summary in the scriplet. Is there a list somewhere of the available variables that can be used in scriplets like this? I realize they probably vary from page to page but if there were a master list showing all of them that would be very helpful in the future.
Re: Category image, title & summary in sidebar
Have a look at this topic
http://wiki.ablecommerce.com/index.php/ ... scriptlets
http://wiki.ablecommerce.com/index.php/ ... scriptlets