Page 1 of 1

Calguys Google Maps 2 - Populating information window...

Posted: Wed Mar 28, 2018 3:50 pm
by PinkElephant
The original thread is locked so...
naturelab wrote:

Code: Select all

{$mapdesc="<h3><a href=$maplink title=$maptitle>{$maptitle}<br /><span style='white-space:nowrap'>Read more &#9654;</span></a></3>" }
I'm surprised that renders. ;) What happens if you quote the link attributes, e.g:

Code: Select all

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

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

Posted: Wed Mar 28, 2018 5:18 pm
by calguy1000
Remember: Smarty will not process anything inside single quotes. It will process stuff inside double quotes.

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

Posted: Wed Mar 28, 2018 5:28 pm
by PinkElephant
calguy1000 wrote:Smarty will not process anything inside single quotes.
Good point! Not the best example then. ;)

I was asking because it looks bug-like to me, where the double quote is escaped twice;

modules\CGGoogleMaps2\lib\class.cggm2_map_generator.php v1.1.1

Code: Select all

261: if( $marker->get_description() ) $rec['bubbletext'] = addslashes($marker->get_description());
593: $out = json_encode($data);
" => \" => \\\"

I've not tested (sorry) but using a simple hard-coded value for desc should point the way.

Code: Select all

desc='<p><a href="https://www.example.com">example link</a></p>'