using an image in the prefix of another field

More
11 years 10 months ago #40538 by rottenberg
hello

I want to use an image whose field name is portrait inside another field.

I have tried those 2 texts in the prefix :
Code:
<div style="float:left;margin-right:5px;margin-bottom:5px;">{{portrait##display_medium_src}}</div>{{legende##0}}
Code:
<div style="float:left;margin-right:5px;margin-bottom:5px;">{{portrait##0##display_medium_src}}</div>{{legende##0}}

In both case I get no image.

When I use {{portrait##display_small_src}} inside the HTML display in reverse related relation. I get the image.

Is it possible to use an image in the prefix of another field ?

thank you for help

best regards

Michel

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

More
11 years 10 months ago #40545 by ggppdk
Hello

no this not proper usage
(please read popup description)

you will see that you can only use raw values and not "display variables" that contain -rendered- (=created) HTML like display_medium_src

-- proper usage is:
{{fieldname##valueno##propname}}

-- this will give you the filename
{{portrait##0##originalname}}

you will need to prepend to it a path and append to it a _l.png or _m.png

-- i think you should not use this , at least not in this case, instead a strongly recommend that you create a custom template and edit the item.php


-- 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
11 years 10 months ago #40559 by rottenberg
thank you

I have followed your advice and customized the itemp.php file.

I think I have got a css problem between FC tab fields in default model template and the CSS I haved added.

I'm now using Nonumber tabs (tab tile is the field label).

Everything seems Ok now.

best regards

Michel

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

More
11 years 10 months ago #41092 by rottenberg
Hello

I have used successfully the orignalname parameter to get the name of the image.

But the image address needs to know the path do get it.

I'm doing it manually (getting the article id and inserting manually the field id in the html)

Is there a way to get also the field id ?

best regards

Michel

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

More
11 years 10 months ago #41097 by ggppdk
Hello

it is best to do this at the template file:

item.php (item_html5.php)
category_items.php (category_items_html5.php)

there you can use these extra display variable of image / gallery fields (always available) are:

Thumbnail URLs of first image only (all thumbnail sizes):
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"} Thumbnail URLs of all images (gallery mode) (all thumbnail sizes) $item->fields['imgfieldname']->thumbs_src['backend'][] $item->fields['imgfieldname']->thumbs_src['small'][] $item->fields['imgfieldname']->thumbs_src['medium'][] $item->fields['imgfieldname']->thumbs_src['large'][] $item->fields['imgfieldname']->thumbs_src['original'] Display Variables having HTML $item->fields['imgfieldname']->display $item->fields['imgfieldname']->display_small $item->fields['imgfieldname']->display_medium $item->fields['imgfieldname']->display_large $item->fields['imgfieldname']->display_original

Regards


-- 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.281 seconds
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