google maps plugin with many flexicontent fields

More
13 years 2 months ago #32993 by ggppdk
This is a lot faster than using Nonumber replacer that acts on all the page, and much easier than changing the template file to trigger the desired content plugin manually.


-- 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
13 years 2 months ago #32995 by brandonking
Nonumber extensions are just temporary solutions.
Definitely, much better to have function like this as core.
You win :D

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

More
13 years 2 months ago #32996 by ggppdk
yes, Nonumber is extension is very good,

just difference with built-in replacement is that it gives you
- easier and
- and more replacement options (in regards with fields values only)
- with a little better performance, because it is done on a small text and not full page HTML


-- 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
13 years 2 months ago #33007 by yopyop001
Hi,

@kenmcd :

Not sure it's the best way but you can edit the file
plugins/flexicontent_fields/flexigmaps.php

to add
Code:
$autoloc_field_1 = "loc_field1"; $autoloc_field_2 = "loc_field2"; $autoloc_field_3 = "loc_field3"; $js_autoloc = " jQuery(document).ready( function() { jQuery('#".$autoloc_field_1."').change(function() { address_value = jQuery('#".$autoloc_field_1." option:selected').text(); address_value += ', ' + jQuery('#".$autoloc_field_2."').val(); jQuery('#address').val(address_value); jQuery('#btn_codeAddr').click(); }); }); "; $document->addScriptDeclaration($js_autoloc);

in function onDisplayField(&$field, $item) juste after
Code:
$document->addScriptDeclaration($js);

(You have to replace loc_field# by your fields name)
Note : use
Code:
jQuery('#".$autoloc_field_1." option:selected').text();
if your filed is a select,
and use
Code:
jQuery('#".$autoloc_field_2."').val()
if your field is a text field

Regards

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

More
13 years 2 months ago #33034 by micker

ggppdk wrote: -- e.g for single property fields (text,date, etc):
{{field19##0}}

-- e.g. for multi-property fields (weblink,email, etc):
{{field19##0##link}} and {{field19##0##addr}}

i resume
1 create a text field with prefix and suffix and actived plugin
2 put {{field19##0}}{{field20##0}}{{field21##0}}
3 in template put field19 field20 field21 in render position
that's all ?? :shock:

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
13 years 2 months ago #33109 by micker
sorry mistake
2 put {{field19##0}}{{field20##0}}{{field21##0}}
3 prefix {mosmap adress='
4 suffix ,YOURCOUNTRY}
that all ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
13 years 2 weeks ago #34784 by fgossart
Hello
Thanks all for your answers. I will now test it.

it seems almost perfect when using prefix etc...

I'd like to add a field with absolute coordonates.
If this field is empty I use the computed value with adress, postcode, town, country
otherwise I use the field's value.
How can I do that ?

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

More
13 years 2 weeks ago #34788 by micker
hello tu confirmes mon mini tuto plus haut ?
Code:
sorry mistake 2 put {{field19##0}}{{field20##0}}{{field21##0}} 3 prefix {mosmap adress=' 4 suffix ,YOURCOUNTRY} that all ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
13 years 2 weeks ago #34789 by fgossart
Here is what I currently use.
The field is only computed so parameter hide in item form set to both.
in the default value to enforce displaying an non empty field I put ',France' my country.
Default value use is above & also display it instead of empty

prefix txt {{adresse##0}},{{codepostal##0}} {{commune##0##_text_}}
(need to be changed with your fields names)

opening text for field {mosmap address='
closing text for field '\zoom='16'}

it's working but I will try to find another way to use alternative values with 2 fields lat and lon.
1)if the fields are 0 and 0 : no gmap should be displayed
2) if the fields are empty (default), use adress, codepostal, etc.. values
3) optionnal ? use a third field to set the zoom value because sometime zoom should be different of default value

To do that I think I have to make my own flexi plugin

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

More
13 years 2 weeks ago #34796 by fgossart
So I have done my own plugin
to use it you need of course to setup googlemap plugin
extensions.joomla.org/extensions/maps-a-...-locations/maps/1147

Then you have to setup a FC field optionnaly if you want to specify a item by item field value

a optionnal googlemap coordonnate value (shown with right clic on gmap info)

and a calculate field with every part of your addresse, city, post code fields (replacing the fields value)

To do not display item by item the gmap plugin just specify a '0' as coordonates (otherwise let it empty to use calculate field)

I still need to make some translations and I can put it there if somebody is interested

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