Fill a field with other fields

More
12 years 3 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
12 years 3 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
12 years 3 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
12 years 3 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 review. Thanks!

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

More
12 years 3 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
12 years 3 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 review. Thanks!

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

More
12 years 2 months ago #43807 by Dias
Replied by Dias on topic Fill a field with other fields
Hello

I've read and read this article, and still do not understand.

{{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

What should I add and where? I understand I must add in one of those parameters, "Prefix...", "Suffix...", "Opening..." and "Closing...".

But in all of them? I think not. And what? Can you please give me an example using the Chabi01 fields?

Do I type in "Prefix text of every value" parameter the values "{{address##0}}{{postcode##0}}{{city##0}}"? Is that so?

And then how do I use (or refer) them in another field?

Also, I've read the article you've mentioned in "How to use raw field values" and still don't understand.

Thank you very much for your help.

Fernando

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

More
12 years 2 months ago #43832 by ggppdk
Hello

1. my previous answer requires editing the field,
i understand that it is not possible / difficult for you,

2. as i said the replacement works with built-in fields provide by FLEXIcontent package, the syntax of the replacement is described in the popup description of the fields that support it
the syntax is

{{fieldname##nn##propertyname}}

so the first part is the field name
How to use raw field values inside the value of other fields

e.g.
For this field (address field with Google Map) which is multi property with a single value (value 0) these can be used in other fields (e.g. use them in the prefix / suffix of a text field)
{{fieldname##0##addr1}}
{{fieldname##0##addr2}}
{{fieldname##0##addr3}}
{{fieldname##0##city}}
{{fieldname##0##state}}
{{fieldname##0##province}}
{{fieldname##0##zip}}
{{fieldname##0##country}}
{{fieldname##0##country2}}
{{fieldname##0##lat}}
{{fieldname##0##lon}}

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 review. Thanks!

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

More
12 years 1 day ago #45733 by Chabi01
Hi !
Back to front :)
I tried to modify the xml and php file to add opening and closing text for the field.
Ok, but this is not working as expected.
The "text" is added above the map but not used to generate the point on the map.

I took a look in the php file and the point are generated with latitude on longitude (retrieved in the admin form when you type an address).
At this point, i don't know if i can put in place the "automatic" filling for this field.

If somebody have an idea...
Thanks to all,

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

More
12 years 1 day ago #45752 by ggppdk
Hello

we have just added (r1866) to CORE distribution the
addressint field
Address international / Google Maps field

contributed by Ruben Reyes

only some minor cleanups done to it,

maybe you can use that


-- 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 review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
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