Links in select fields

More
12 years 2 months ago - 12 years 2 months ago #35183 by bendeb
Hello,

I have post a message in the feature request forum but I delete it because maybe there is already a solution to my problem. :)

I wish to have a select list field (or any other select fields : checkbox, single list multiple...) with a different link for each value.

I have tried this in the field element but it doesn't work as I want :
Code:
1::[url=link-1.com]Value 1[/url]%% 2::[url=link-2.org]Value 2[/url]%% ...

When I go to the item form, the list displays all values but with html tags (<a href="...">) and it's not beautiful nor handy to choose the value we want, because of these very long html tags. :?
Anyway, when I submit the item, the value display the link correctly. :)

Is it possible to remove these html tags and URL in the list of the select field, to only have the values ?

I also tried the Link list field, but it's not exactly what I want because of the html list structure and the multiple checkbox.

Thank for your answer. :)

Flexicontent 4.1.0b1
Joomla 3.9.18
Last edit: 12 years 2 months ago by bendeb.

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

More
12 years 2 months ago #35187 by brandonking
Replied by brandonking on topic Links in select fields
In select list field,
Fields elements should be
1::link-1.com">Value 1%% 2::link-2.org">Value 2

Pretext of the value: <a href="
Posttext of the value:

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

More
12 years 2 months ago #35206 by bendeb
Replied by bendeb on topic Links in select fields
Thank you for your reply. :)

I have thought about prefix and suffix, it works to not display html tags.
But to have different link for each value, I have to put the url link in the value like this :

1::www.link.com">Value1%%

I wish to only have Value1, no html tags nor url in the select list. :)

Flexicontent 4.1.0b1
Joomla 3.9.18

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

More
12 years 2 months ago #35252 by bendeb
Replied by bendeb on topic Links in select fields
I infer that this feature isn't feasible at the time being. :|
Is it possible to implement this field parameter (or maybe a new field type explicitly for that) on a next release ?

Thank you for your answer. :)

Flexicontent 4.1.0b1
Joomla 3.9.18

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

More
12 years 2 months ago #35276 by bendeb
Replied by bendeb on topic Links in select fields
I found a solution to my problem, but it's not very handly. :?

In item.php (of my template) I put this code :
Code:
<?php $automatic_link = array( 'Value n°1' => 'http://www.mylink-1.com', 'Value n°2 => 'http://www.mylink-2.com', // and so on for each field value ); foreach($automatic_link as $term => $url) { $reg = "|$term|i"; $this->fields['myfield1']->display = preg_replace($reg, '[url='.$url.']'.$term.'[/url]',$this->fields['myfield1']->display, 1); $this->fields['myfield2']->display = preg_replace($reg, '[url='.$url.']'.$term.'[/url]',$this->fields['myfield2']->display, 1); // ans so on for each field type I want to relate with automatic link } ?>

It works, but I have to fix a "value" in array (term + url) for each term in the source code.
It will be more handly if this function exist in the field parameters.

Flexicontent 4.1.0b1
Joomla 3.9.18

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

More
12 years 2 months ago #35289 by ggppdk
Replied by ggppdk on topic Links in select fields
So you propose that the FLEXIcontent "indexable" fields

select, mulitple-select, checkbox, checkboximage, radio, radioimage

to also support linking?

About your solution it is good, except that you need edit the template if you add more values to the field,

also performance impact it is none
unless hundreds of values assigned to each item and you have a category view with hundreds of items per page


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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.362 seconds
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
Save