How to create a link to the item within a field ?

More
9 years 3 months ago - 9 years 3 months ago #56688 by geejay
Hello,

I want to create a field which shows an image which links to the item. The purpose is to show nicely styled links to the items in category tables and blogs. The problem is that I cannot figure out how to get the link to the item in the field. I want to set this as the default link of the image.

It seems that the link does not exist as replacement value
www.flexicontent.org/documentation/faq/7...of-other-fields.html

Any help would be greatly appreciated.

Thanks

Geejay
Last edit: 9 years 3 months ago by geejay.

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

More
9 years 3 months ago - 9 years 3 months ago #56690 by ggppdk
Hello

you can use a FLEXIcontent image field


- if you want to reuse your image inside different items,
then set field to "DB-mode", if images are unique to every item, or if they are rarely re-used, set image field to folder mode

- to manually create an item link , you can find the link inside item.php,
search for "getItemRoute" inside category_items(_htmp) it is like this:
Code:
$item_link = JRoute::_(FlexicontentHelperRoute::getItemRoute($item->slug, $item->categoryslug, 0, $item));

to get the the thumbnail path of an image field:
Code:
$item->fields['imgfieldname']->{"display_backend_src"} $item->fields['imgfieldname']->{"display_small_src"} $item->fields['imgfieldname']->{"display_medium_src"} $item->fields['imgfieldname']->{"display_large_src"} $item->fields['imgfieldname']->{"display_original_src"}

see more here:
www.flexicontent.org/documentation/faq/7...e-gallery-field.html


-- 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...
Attachments:
Last edit: 9 years 3 months ago by ggppdk.

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

More
9 years 3 months ago #56691 by geejay
Hi,

Thank your for you fast response. I had missed this because I had not switched in single image mode.

BR

Geejay

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

More
9 years 3 months ago #56692 by ggppdk
Hello

you don't need to use single image mode
image field can be multi-value,
- the first image (re-order to place first) will be used to link to the item

just enable the parameter, and add your image field to a template position


-- 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 3 months ago - 9 years 3 months ago #56693 by geejay
Just discovered another bug related to this and fieldgroup:
When putting an image with "link to item" activated into a fieldgroup of images then the image disappears - it is replaced by a triangle bracket "<"

The same happens when using custom html in the fieldgroup.

BTW: Sometimes I think that myriad of parameters makes FC sometimes overly complex and prone to errors. I have been working some years in FC and still get lost. For example a fieldgroup could probably much easier be realized by some macro language - like you already have it in the custom html. However one should extend the macro language by more complex functions. That would allow to eliminate parameters. Also such thing like "link to item" could be done with a simple predefined constant. Just my 0.25 cents of cause.
Last edit: 9 years 3 months ago by geejay.

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

More
9 years 3 months ago #56694 by ggppdk
Hello

are you using v3.0.6 ?

link to item is not meant to be used with fieldgroup,

-- when you see a "<" in fieldgroup display it means that the field was treat like it was not inside a fieldgroup
when a field is inside an item it creates an array of HTML content instead of a single string with HTML

i ll check if it is an unhandle case, and fix this

about parameters, the alternative to having parameters is to ask user to do some coding


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