Fill a field with other fields

More
10 years 5 months ago #42477 by Chabi01
Hi ! Me again :)

Another question with the google map field.
You have in the gmap field a place to type the address.

In my article, i allready have fields called address, postcode and city.

Each time i have to fill the fields, i type the address, the postcode and the city and i type a second time exactly the same thing in the gmap field.

Is that possible to fill automatically the gmap field ?
An idea to how to do that ? Is it possible directly ?

Thanks :)
Regards

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

More
10 years 5 months ago #42478 by nemicker
insert this in your value
Code:
{{fieldname1##0}}{{fieldname2##0}} etc

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

More
10 years 5 months ago #42480 by Chabi01
Hi nemicker,
If i understand well,
I have to put
Code:
{{address##0}}{{postcode##0}}{{city##0}}
in my value... but where ?
In the field configuration, i have no where to put this code (i use Flexigmaps plugin) or i miss the point.

A additional question with this : are the concatened field Gmap will have the 3 fields separate with a space ?
Thanks for your help :)
Regards.

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

More
10 years 5 months ago #42484 by ggppdk
hello

about:
{{address##0}}{{postcode##0}}{{city##0}}

address, postcode, city are field names ?

if so then you can add these replacements inside the parameters:

- Prefix text of every value
- Suffix text of every value
- Opening text for Field
- Closing text for Field

the replacement description maybe missing from this field,
open e.g. text field and goto prefix/suffix/... variables, above the there is a header
"Prefix - Suffix - Separator" , place mouse over it to see the description

Have copied the above description to this FAQ article:
How to use raw field values inside the value of other fields


-- 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 5 months ago #42709 by Chabi01
Hi, i'm back !

I understand well your explanation (i hope so :lol: )
But if i take a look to the field, i have not the parameters you talk about : i used Flexigmap field..
Did i miss something ?

Regards,

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

More
10 years 5 months ago #42729 by ggppdk
Hello

1. yes the answer was about built-in fields,
... Flexigmap field was created before this feature was added, and the replacement code is missing from the field

2. You can try / attempt / test adding the feature :

add to the XML file of the field these (if they do not exist already):
Code:
<field name="opentag" type="text" default="" label="FLEXI_FIELD_OPENING_TEXT" description="FLEXI_FIELD_OPENING_TEXT_DESC" /> <field name="closetag" type="text" default="" label="FLEXI_FIELD_CLOSING_TEXT" description="FLEXI_FIELD_CLOSING_TEXT_DESC" />

and at the end of
onDisplayFieldValue(...)

add this:
Code:
$opentag = FlexicontentFields::replaceFieldValue( $field, $item, $field->parameters->get( 'opentag', '' ), 'opentag' ); $closetag = FlexicontentFields::replaceFieldValue( $field, $item, $field->parameters->get( 'closetag', '' ), 'closetag' ); $field->display = $opentag . $field->display . $closetag;


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