Multi-value field: add an icon depending on the value

More
7 years 1 month ago - 7 years 1 month ago #66531 by hervemlam
Hello,

At my website I've got a weblink field that allows multiple values, as you can see it on this screenshot:


(Source page: japprecie.raidghost.com/dralms-shook )

This is fine, but I'd like to improve it.
I want to add an appropriate icon in front of each value... depending on the value! I mean: for the SoundCloud link, add a SoundCloud icon, for the YouTube link a YouTube icon, and so on. Do you think it is possible?

I would easily manage to achieve a given same icon, using field properties Viewing > Value list > Every value prefix and Every value suffix.
But is it possible to use a specific syntax inside prefix property to say: if the value contains "soundcloud" then <img src="soundcloud.png"> else..., etc. ?

Good night.
HervE

PHP 8.1.16
Joomla! 4.3.3
FLEXIcontent 4.1.5
Attachments:
Last edit: 7 years 1 month ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago #66535 by ggppdk
Hello

you can use it only by using CSS class and
adding a left or right padding and a background inside the padding

1. you can change the type of "weblink" field to "extendend weblink" field
2. find the parameter for enabling "Styling (CSS) Class"
configure the CSS classes and their label (so that you can select them via a drop down in item form)
3. save the field configuration
3. then inside the item form every time that you add a value you can also select a CSS class too for styling


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
The following user(s) said Thank You: hervemlam

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago #66606 by hervemlam
Hello,

Done. I had to add some code like this in the CSS of my template:
Code:
.DeezerLink { background-image: url("/images/favicon-v00351961.ico"); background-size: 16px 16px; background-position: left center; background-repeat: no-repeat; padding-left:20px; }
(etc.)

And here is the (very nice) result - like expected:


Many thanks!

Good night.
HervE

PHP 8.1.16
Joomla! 4.3.3
FLEXIcontent 4.1.5
Attachments:

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago #66619 by ggppdk
Hello

thanks for the sample CSS, i am sure other people using the extended weblink field, will also find useful in the future


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago #66624 by hervemlam
Hello,

That's the reason why I posted ;)

Good night.
HervE

PHP 8.1.16
Joomla! 4.3.3
FLEXIcontent 4.1.5

Please Log in or Create an account to join the conversation.

More
7 years 3 weeks ago #66871 by hervemlam
Hello,

Just a detail.
I observed there is this gap between the label and the values, for a multi-values field compared to single-value fields (shown in red below).
Do you know why, and how I could avoid it?


The page is here , if it helps.

Good night.
HervE

PHP 8.1.16
Joomla! 4.3.3
FLEXIcontent 4.1.5
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.627 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline