[SOLVED] Several links in a field - HTML list of URLs / Anchors / JS links -

More
7 years 5 months ago - 7 years 5 months ago #64563 by ilo
Hello,
I would like to allow user to choose différents values matching with différents links displayed on an item.
It seems to be possible with field " HTML list of URLs / Anchors / JS links ", but I can't display any link with specific Flexicontent syntax, like {{item->id}}. For exemple, the element list :

Title1[id="tagid1" class="list-group-item" link=" www.mywebsite/index.php/category-1/item/{{item- >id}}"] ::

display a link with an other syntax on the item :

www.3.mywebsite/index.php/category-1/ite...B%7Bitem-%3Eid%7D%7D

And this link don't work, how can I do please ?
Last edit: 7 years 5 months ago by ggppdk.

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

More
7 years 5 months ago #64564 by micker
why you didn't use select field with an sql request to find item id
after tou can add <a href="http://url in prefix and ">yourlink name

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
7 years 5 months ago #64568 by ilo
I don't use url in prefix because in this way it isn't possible to define several links in the same field.

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

More
7 years 5 months ago #64570 by micker
i don't undesrtand why ... in your exemple all urls prefix are same ....

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
7 years 5 months ago #64592 by ilo
I want to display one field with différents possibles values, which are links like :

www.mywebsite/index.php/category-1/item/{{item- >id}} for the first value-link
www.mywebsite/index.php/category-1/authored/{{item- >created_by}} for the second value-link
without link for the third value (without link)

Is there a way to do this please ?

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

More
7 years 5 months ago - 7 years 5 months ago #64594 by ggppdk
Hello

if you only want to do "displaying"

then a more
- powerful and flexible way is to use a custom layout for the select field

1. Create a SELECT field with 3 options
1::LinkType1%% 2::LinkType2%% 1::LinkType3%%

2. Create a custom layout file, by coping:

plugins/flexicontent_fields/select/tmpl/value_default.php

as

plugins/flexicontent_fields/select/tmpl/value_mylinks_unique_name.php


(make a good name so that it is unique and it will not be overwritten in future)

3. Find code:
Code:
if ($text_or_value == 0) $disp = $element->value; else if ($text_or_value == 1) $disp = $element->text; /* only for (*IMAGE) fields */ else if ($text_or_value == 2) $disp = !$image_type ? '<img src="'.$imgpath . $element->image .'" class="fc_ifield_val_img '.$tooltip_class.'" title="'.flexicontent_html::getToolTip(null, $element->text, 0).'" alt="'.$element->text.'" />' : '<span class="'. $_class .' '. $element->image .'" style="'.($icon_color ? 'color: '.$icon_color.';' : '').'" title="'.flexicontent_html::getToolTip(null, $element->text, 0).'"></span>' ; else $disp = ' <div class="fc_ifield_val_box"> '.(!$image_type ? '<img src="'. $imgpath . $element->image .'" class="fc_ifield_val_img '.($text_or_value == 4 ? $tooltip_class : '').'" '.($text_or_value == 4 ? 'title="'.flexicontent_html::getToolTip(null, $element->text, 0).'"' : '').' alt="'.$element->text.'" />' : '<span class="'. $_class .' '. $element->image .'" style="'.($icon_color ? 'color: '.$icon_color.';' : '').'" '.($text_or_value == 4 ? ' title="'.flexicontent_html::getToolTip(null, $element->text, 0).'"' : '').'"></span>' ).' <span class="alert alert-info fc_ifield_val_txt">'.($text_or_value == 3 ? $element->text : $element->value).'</span> </div> ';

Replace it with:
Code:
if ($element->value == '0') $disp = '<a href=".../category-1/item/'.$item->id.'">Some Text ITEM</a>'; else if ($element->value == '1') $disp = '<a href=".../category-1/authored/'.$item->created_by.'">Some Text CREATED</a>'; else if ($element->value == '2') $disp = 'Some text 3rd choice'; else $disp = 'Bad value for link type: '. $element->value;


-- 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: 7 years 5 months ago by ggppdk.
The following user(s) said Thank You: ilo

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

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