More in this section

Forums / Developing with Sitefinity / Is there a way to associate an image with a category

Is there a way to associate an image with a category

2 posts, 0 answered
  1. Mike
    Mike avatar
    7 posts
    13 Nov 2008
    08 Jan 2009
    Link to this post
    I am using the sample products module with categories enabled. However I would like the be able to associate an image with a category, so that on the public site I can have first have a list of categories with a category thumbnail that then links to the products belonging to that category.

    Is this possible or am I able to implement this another way?


  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    09 Jan 2009
    Link to this post
    Hello Mike,

    Thank you for using our services.

    Here are the steps that you should follow to implement desired functionality. You should create your
    custom Modes with custom UI. Let's call it "CategoryPreperties". Then, based on the command name set the Mode of the CommandPanel if you click "CategoryPreperties" button. You need to have added link button in the Products module CommandPanel template.

    Overriding CreateChildControls method you add your custom interface. For instance you could have  a DropDownList control populated/bound with/to categories from ProductsModule. You could add RadUpload control which allows you to upload images, or use selectors. You could add Description fields to the images ( as it is in Images and Libraries)

    The third major step is creating additional table in Sitefinity's database. Let's call it CategoryProperties. For instance the table should have the following columns - CategoryID, ImageCat, Description. In this way on the public part the database will collects data for your category and corresponding image for that category.

    Here are some useful links, check out working with selectors.
    Extending the CommandPanel of the Products module
    Set Category after uploading documents

    I hope this helps.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered