Calguys Google Maps 2 - Populating information window...

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
naturelab
Forum Members
Forum Members
Posts: 169
Joined: Thu Oct 15, 2009 11:11 am

Calguys Google Maps 2 - Populating information window...

Post by naturelab »

I am using Calguys Google Maps 2, and populating the information window dynamically with a simple link, using the code below.

It has stopped working, but I am pretty sure this was working previously, before a recent update. map is here

Code: Select all

http://www.orchardlink.org.uk/dev/growing-orchard-communities-project/about-the-sites/

Code: Select all

<!-- Create Map -->
{$children=cgsimple::get_children('about-the-sites')}
{foreach from=$children item='child'}
{if $child.show_in_menu}


{$maptitle=cgsimple::get_page_title($child.alias)}
{$popuptxt=cgsimple::get_page_content($child.alias)|truncate:40}
{page_attr page=$child.alias key="show_on_home" assign='showonhome'}

{cms_selflink page=$child.alias text="<strong>`$maptitle`</strong><br /><span>Read more &#9654;</span>" title="`$maptitle` - Read more" assign='maplink'}

{if $page_alias == $child.alias }
{assign var="icon" value='dd-end'}
{else}
{assign var="icon" value='OL_Marker'}
{/if}

{if !empty( {page_attr page=$child.alias key='latitude'}  )}
{cggm2_add_dynpoint map=1 name=$maptitle lat={page_attr page=$child.alias key='latitude'} long={page_attr page=$child.alias key='longitude'} desc="<h4>`$maplink`</h4>" icon=$icon }

 {/if}
{/if}
{/foreach}

{CGGoogleMaps2}

Code: Select all

----------------------------------------------

Cms Version: 2.2.6

Installed Modules:

    AdminSearch: 1.0.4
    CGBlog: 1.15.7
    CGContentUtils: 2.2.2
    CGExtensions: 1.60
    CGGoogleMaps2: 1.1.1
    CGSimpleSmarty: 2.1.8
    CGSnapshot: 1.3
    CMSContentManager: 1.1.6
    CMSMailer: 6.2.14
    CmsJobManager: 0.1.2
    DesignManager: 1.1.4
    FileManager: 1.6.5
    FilePicker: 1.0.2
    FormBuilder: 0.8.1.6
    Gallery: 2.3.2
    JQueryTools: 1.4.0.3
    MenuManager: 1.50.3
    MicroTiny: 2.2.2
    ModuleManager: 2.1.3
    Navigator: 1.0.8
    News: 2.51.3
    Search: 1.51.3
    Uploads: 1.25.8


Config Information:

    php_memory_limit:
    max_upload_size: 2000000
    url_rewriting: mod_rewrite
    page_extension: /
    query_var: page
    auto_alias_content: true
    locale:
    set_names: true
    timezone: Europe/London
    permissive_smarty: false


Php Information:

    phpversion: 5.6.34
    md5_function: On (True)
    json_function: On (True)
    gd_version: 2
    tempnam_function: On (True)
    magic_quotes_runtime: Off (False)
    E_ALL: 32767
    E_STRICT: 2048
    E_DEPRECATED: 8192
    test_file_timedifference: No time difference found
    test_db_timedifference: No time difference found
    create_dir_and_file: 1
    memory_limit: 128M
    max_execution_time: 30
    register_globals: Off (False)
    output_buffering: 4096
    disable_functions: symlink, dl, system, passthru, exec, shell_exec, escapeshellarg, escapeshellcmd, popen, posix_uname
    open_basedir:
    test_remote_url: Success
    file_uploads: On (True)
    post_max_size: 8M
    upload_max_filesize: 2M
    session_save_path: /tmp (0700)
    session_use_cookies: On (True)
    xml_function: On (True)
    xmlreader_class: On (True)
    check_ini_set: On (True)
    curl: On

naturelab
Forum Members
Forum Members
Posts: 169
Joined: Thu Oct 15, 2009 11:11 am

Re: Calguys Google Maps 2 - Populating information window...

Post by naturelab »

calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Calguys Google Maps 2 - Populating information window...

Post by calguy1000 »

seems to be working fine now.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
naturelab
Forum Members
Forum Members
Posts: 169
Joined: Thu Oct 15, 2009 11:11 am

Re: Calguys Google Maps 2 - Populating information window...

Post by naturelab »

No, it isn't for me.

Just to be clear, the links I am talking about are in the info window, which pops up on each map marker...

Does it work for you ? strange ?
Attachments
Screen Shot 2018-03-27 at 22.18.31.png
Screen Shot 2018-03-27 at 22.18.31.png (110.74 KiB) Viewed 2528 times
User avatar
PinkElephant
Forum Members
Forum Members
Posts: 169
Joined: Fri Feb 06, 2009 2:08 pm

Re: Calguys Google Maps 2 - Populating information window...

Post by PinkElephant »

Caveat: I don't use the module so I might be more off-track than usual...

The js bubbletext value looks over-escaped, or rather, it looks like an extraneous "\" at the start and end of the <a> element's attributes:

Code: Select all

{   "name"       :  "Ashmeadow_Community_Orchard",
    "position"   :  [50.40257,-3.66177],
    "icon"       :  "dd-end",
    "title"      :  "Ashmeadow Community Orchard",
    "tooltip"    :  "Ashmeadow Community Orchard",
    "bubbletext" :  "<h4><a href=\\\"https:\/\/www.orchardlink.org.uk\/dev\/growing-orchard-communities-project\/about-the-sites\/ashmeadow-community-orchard\/\\\"
                    title=\\\"Ashmeadow Community Orchard - Read more\\\" ><strong>Ashmeadow Community Orchard<\/strong><br \/><span>Read more &#9654;<\/span><\/a><\/h4>"
},
I'm assuming the value arrives via the map's `desc` value:

Code: Select all

desc="<h4>`$maplink`</h4>"
where $maplink is

Code: Select all

{cms_selflink page=$child.alias text="<strong>`$maptitle`</strong><br /><span>Read more &#9654;</span>" title="`$maptitle` - Read more"}
I'm not sure if or where the encoding is tripping up but have you tried without the two sets of `backticks`? Either way, it could be useful to get the loop to print the value of $maplink before it's passed to the map, e.g:

Code: Select all

{$latitude = {page_attr page=$child.alias key='latitude'}}
{if !empty($latitude)}
	<!-- DEBUG $maplink: {$maplink} -->
	{cggm2_add_dynpoint map=1 name=$maptitle lat={$latitude} long={page_attr page=$child.alias key='longitude'} desc="<h4>`$maplink`</h4>" icon=$icon}
{/if}
naturelab
Forum Members
Forum Members
Posts: 169
Joined: Thu Oct 15, 2009 11:11 am

Re: Calguys Google Maps 2 - Populating information window...

Post by naturelab »

Thankyou so much for your time on this !

What you were suggesting is the first route I went down, however, if I simply print

Code: Select all

<h3>{$maplink}</h3>
Then you can see that the links are perfectly formed at this stage.
It is not until they are placed into the Map module that the issue occurs.
Attachments
Screen Shot 2018-03-28 at 12.59.57.png
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Calguys Google Maps 2 - Populating information window...

Post by calguy1000 »

If it is just an escaping issue... I would not use {cms_selflink page=whatever} but {cms_selflink href=whatever} and build the links myself.

And watch the use of backticks.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
naturelab
Forum Members
Forum Members
Posts: 169
Joined: Thu Oct 15, 2009 11:11 am

Re: Calguys Google Maps 2 - Populating information window...

Post by naturelab »

Thanks for the pointers chaps !
Fixed it :-* !

Code: Select all

<!-- Create Map -->
{$children=cgsimple::get_children('about-the-sites')}
{foreach from=$children item='child'}
{if $child.show_in_menu}


{$maptitle=cgsimple::get_page_title($child.alias)}
{$popuptxt=cgsimple::get_page_content($child.alias)|truncate:40}
{page_attr page=$child.alias key="show_on_home" assign='showonhome'}

{cms_selflink href=$child.alias assign='maplink'}
{$mapdesc="<h3><a href=$maplink title=$maptitle>{$maptitle}<br /><span style='white-space:nowrap'>Read more &#9654;</span></a></3>" }

{if $page_alias == $child.alias }
{assign var="icon" value='dd-end'}
{else}
{assign var="icon" value='OL_Marker'}
{/if}

{if !empty( {page_attr page=$child.alias key='latitude'}  )}
{cggm2_add_dynpoint map=1 name=$maptitle lat={page_attr page=$child.alias key='latitude'} long={page_attr page=$child.alias key='longitude'} desc=$mapdesc icon=$icon }

 {/if}
{/if}
{/foreach}

{CGGoogleMaps2}
Locked

Return to “Modules/Add-Ons”