Category image, title & summary in sidebar

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
User avatar
GrfxDan
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 82
Joined: Sat May 26, 2007 10:58 am
Location: Mt Zion, IL
Contact:

Category image, title & summary in sidebar

Post by GrfxDan » Wed Jan 05, 2011 8:59 am

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
<><
Image

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Category image, title & summary in sidebar

Post by mazhar » Wed Jan 05, 2011 10:21 am

1) The category image
You can do something like this on category page scriptlets

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
Finally have a look at this control as well.
viewtopic.php?f=47&t=14818

User avatar
GrfxDan
Lieutenant Commander (LCDR)
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

Post by GrfxDan » Wed Jan 05, 2011 11:22 am

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!
Image

User avatar
GrfxDan
Lieutenant Commander (LCDR)
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

Post by GrfxDan » Wed Jan 05, 2011 11:26 am

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.
Image

User avatar
GrfxDan
Lieutenant Commander (LCDR)
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

Post by GrfxDan » Sun Jan 09, 2011 1:03 pm

Anyone know how to do this?
Image


Post Reply