[SOLVED] Category layout : how to choose 2 images source field

More
8 years 2 months ago - 8 years 2 months ago #64880 by ggppdk
Hello

i guess you did not use:

$item->fields->{"display_medium_src"}
- it does not exist

you meant something like:
$item->fields->{"display_medium_src"}




IF the image field is in a fieldgroup

$item->fields->{"display_medium_src"}

is an array of image URLs , all images of the field

- It is an array even if you only have 1 image

so use: [0] to get first element
that is :

$item->fields->{"display_medium_src"}[0]

So you get:
Code:
<img src="<?php echo $item->fields['field104']->{"display_medium_src"}[0]; ?>"


Also i see you have an IF statement
Code:
<?php if ($this->params->get('intro_link_image', 1) && $item->fields['field104']) : ?>

use:
Code:
<?php if ($this->params->get('intro_link_image', 1) && $item->fields['field104'] && !empty($item->fields['field104']->{"display_medium_src"}) ) : ?>


-- 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: 8 years 2 months ago by ggppdk.

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

More
8 years 1 month ago #64951 by lclaude
Hello

I worked on this issue for a long time, with no results.

I found today...
It was because I didn't put my field in the template, in render only position :sick:
Grrrr, shame on me!

Finally I learned more how thumbs works ;)
Many thanks for your support.

Laurent

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

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