143 Posts
Stef
10 years ago
3
Topic

Hi Seblod, Thanks by advance for any help in this case :

I have a form for courses :

Name | Descr. | Date | Price | Category (Select)

The form for categories of courses :

Name

The list & Type search for courses proposed :

Cat. | Name | Date | Price

Now I would like to display an icon per course wich symbolize the category. I thought about adding an image to each category and call it in the list, but I didn't find any field "Category image" to add to my List & Search. Maybe it is not the good way. Anyone to give me a track ? Thanks by advance...

Get a Book for SEBLOD
143 Posts
Stef
10 years ago
0
Level 1

I think I have found a good beginning for this situation.

I have created a text field. In Admin and Site form i have added a conditionnal state (5) With :

  • Field "is filled" with "images/formations/cat_justice.png" WHEN "Article Category Id" is equal "10"

That's work with one condition. Now, i have tried to add condition so it will choose an image path for each category. But it stop working at one. If I add a second condition (AND or OR) It doesn't work anymore. Any suggestion for that ?

4229 Posts
Kadministrator
10 years ago
0
Level 1

This would be easiest done as template override, but you can also do it with conditionals, you just need to approach it a bit differently - for each category create and icon field and set them all as hidden variation, then put condition "is shown" on each one (with WHEN part the same as you have it now)

10 years ago
0
Level 1

Hi Stef,

Let us knwo if you find a solution to this need.

I think a best way to do what you want is:

  1. add an "upload image" field to your category content type. With this way you can fill a name and add an image "icon" to a category
  2. In the "item" view of your search type that display courses you should have field "Article Category Id".
  3. override the template that display the courses list. In this override you will have a the id of category by the code "$cck->getValue( 'art_catid')". You can apply a SQL query to retrieve the path of the correspendant icon.

Regards,
Mehdi.

Get a Book for SEBLOD