Field value replacements in prefix/suffix do not support multi-value replacements

More
9 years 1 week ago - 9 years 1 week ago #57887 by MikeM
I create a selectmultiple field with values
Code:
pc::PC%% xbox::XBOX%% ps::PS%%
Then i create a prefix for this field:
Code:
<a href="/news/{{news##0##_value_}}">

When i choose 1 options for article - it work ok and look like:
Code:
<span class="flexi value field_news "> <a href="/news/pc"> PC </a> </span>

But when i choose more than 1 options, link are broken, and it loos like:
Code:
<span class="flexi value field_news "> <a href="/news/pc"> PC </a> <a href="/news/pc"> XBOX </a> <a href="/news/pc"> PS </a> </span>

What i do wrong?
Last edit: 9 years 1 week ago by ggppdk.

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

More
9 years 1 week ago - 9 years 1 week ago #57899 by ggppdk
Hello

yes it is good for only 1 value,

Instead of this
Code:
<a href="/news/{{news##0##_value_}}">

it would be nice to support something like this:
Code:
<a href="/news/{{news##AUTO_INCREMENT##_value_}}">

- unfortunately this involves updating the code of ALL fields
Add this and it may be done in the future
github.com/FLEXIcontent/flexicontent-cck/issues/324


- An alternative is to use a field group field
which is good for item form
and you can use its custom templating parameter to achieve what you need


-- 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...
Last edit: 9 years 1 week ago by ggppdk.
The following user(s) said Thank You: MikeM

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

More
9 years 1 week ago #57906 by ggppdk
Hello

I changed your title "Problem in selectmultiple"

as it is really not appropriate, it gives very little information about your thread
and the discussed topic involves all fields and not selectmultiple specifically


-- 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
9 years 1 week ago #57915 by MikeM

ggppdk wrote: - An alternative is to use a field group field
which is good for item form
and you can use its custom templating parameter to achieve what you need


Thank you for answer.

I dont know how usefield group field in my project :unsure:
I do it with JS:
Code:
$('.field_news').find('a').removeAttr("href"); $('.field_news').find('a').each(function(){ var link = ''; var newscat = $(this).html(); switch (newscat ) { case 'PC': link = 'pc'; break; case 'XBOX': link = 'xbox'; break; case 'PS': link = 'ps'; break; } $(this).attr("href",'/news/'+link); });

But this is not good for search engines.
How i can constuct this JS script with PHP in item.php template?

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.274 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