Links in select fields

More
12 years 11 months ago - 12 years 11 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 11 months ago by bendeb.

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

More
12 years 11 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 11 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 11 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 11 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 11 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 review. Thanks!

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

More
12 years 11 months ago #35290 by bendeb
Replied by bendeb on topic Links in select fields

ggppdk wrote: So you propose that the FLEXIcontent "indexable" fields

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

to also support linking?

Yes, it's exactly that ! It will be very very very nice ! :)

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

It's my problem at the time being : I have to create a lot of links, and edit the item.php every time, and the source code will become very very long... :?

If we can add link (and why not item ID too) to each values of "selection type field" (checkbox, select list...) it give me life easier, really, and I think this new feature will be very nice for multiple reasons :P

Thank in advance. :)

Flexicontent 4.1.0b1
Joomla 3.9.18

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

More
12 years 11 months ago #35294 by ggppdk
Replied by ggppdk on topic Links in select fields
Hello,
the links must be fixed ones and reusable?
so that item editor will select from these without being allowed to enter links of his/her own?

or can the item editor write the links, in this case maybe it could be comfortable to use the weblink or the extended-weblink field?


-- 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 review. Thanks!

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

More
12 years 11 months ago #35301 by bendeb
Replied by bendeb on topic Links in select fields
Hello,

In my case it's only to put an url on a value field (and possibly to change it when I want).

Example for select list multiple or checkbox (or others) :
1::value1::link1%% 2::value2::link2%% etc.

So only the field manager (administrators and those who is allowed to edit fields) can edit these links in field parameters.

I have a type template which display many field values (by selectionning it with list multiple, checkbox...), and I simply wish that some values could be a link to an item or an external url. :)

Flexicontent 4.1.0b1
Joomla 3.9.18

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

More
12 years 10 months ago #36448 by bendeb
Replied by bendeb on topic Links in select fields
Hello,

I wish to know if this feature is in the TODO list for a next release of Flexicontent.
I still think this feature would be very handy for multiple purposes.
Thank you. :)

Flexicontent 4.1.0b1
Joomla 3.9.18

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

Moderators: vistamediajoomlacornerggppdk
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