10 years ago
5
Topic

Hi,

I created a simple form to manage my custom keywords : keyword name (text) AND a an icon (image) as fields

In my article form I added a checkbox field to list all my keywords and make the user able to select the keywords (text).
But when article is displayed I would prefer displaying the icons instead of a list of textual keywords : To get a single and nice row of icons !

As only the text value is recorded in the article, is there any way to get the icon associated with the keyword ?

Thanks for your help,

Regards,

Get a Book for SEBLOD
10 years ago
4
Level 1

Hi Lionel77,

You can use for that a typography plugin "HTML" by clicking on button "2" in the content view.

Regards,
Mehdi

10 years ago
3
Level 2

Hi Mehdi,

Thanks for your quick reply,

I tried to use HTML or Image but I didn't succeed !

Can you give me more detail about the synthax to use or a sample code to put in the field ?

Note : In the article, there is no image. Juste the keyword linked to the keyword form where the associated picture is located.

Many thanks for your support,

10 years ago
2
Level 3

Hi Lionel77,

You can use syntax like that:

$cck->getValue('name_of_tag_field') <img src="/path_of_the_desired_icon"/>

Regards,
Mehdi

10 years ago
1
Level 4

Ok, but I don't understand how it will link the text value of the field (value(s) behind "name_of_the_tag_field") to a "dynamic" path to the image depending of the value of the checkbox.

10 years ago
0
Level 5

Lionel77,

In this case, you can define each option of the checkbox field like "text you want to display=path of the corresponding icon".

Regards,
Mehdi

Get a Book for SEBLOD