Using file field as value on other field

More
10 years 2 months ago #49304 by jrodgar
Hi!

I have a field of file type that I want to display on two differents places

I´m reading this tutorial ( www.flexicontent.org/documentati ... ?view=item ), but I don´t get the proper value to show. How can be made?

Edit: Without creating a custom field preferably

Unless otherwise indicated:
Joomla 3.8.1
Flexicontent 3.2.1.7

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

More
10 years 2 months ago #49310 by ggppdk
Hello

To use file data inside another field you will need to duplicate the field (see our FAQ), then change you old field type to the new duplicated field and inside the function

onDisplayFieldValue use:

$item->fieldvalues[...field_id_of_file_field...]

-- so a more appropriate FAQ article is this:

www.flexicontent.org/documentati ... ?view=item



-- another alternative is to create the file field HTML display (put it in the "renderonly" position) and the use inside your template:

$item->fields[...fieldname...]->file_data

do a print_r on it

also the above will be available inside the function onDisplayFieldValue, if the file field display is created before you customly developed field

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.

More
10 years 2 months ago #49369 by jrodgar
Thanks!

The renderonly wasn´t working properly, but I used the method getFieldDisplay, or something like that, to generate the value when needed.

Unless otherwise indicated:
Joomla 3.8.1
Flexicontent 3.2.1.7

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

More
10 years 2 months ago #49379 by ggppdk
Hello

The renderonly wasn´t working properly,


you mean that the position does not appear in you template ?

or do you mean that:
$item->fields[...fieldname...]
is empty ?


-- 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
10 years 2 months ago #49386 by jrodgar
The second, $item->fields[...fieldname...] was empty

Unless otherwise indicated:
Joomla 3.8.1
Flexicontent 3.2.1.7

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

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