Categories > TinyButStrong general >

Show link in webpage (Google Map code)

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Dennis Hoogendonk
Date: 2009-07-27
Time: 13:06

Show link in webpage (Google Map code)

Here's a question I was unable to figure out myself.

My database stores Google Map links as 'http://maps.google. etcetera'.

On my webpage I want it displayed as 'Click here' .


Off course, I can retrieve my data as '{a2.Map}' but then I only get the complete link. Till now I'm unable to format data to a working link. I have to embrace the code with some HTML (<a href=" + >Click here</a>.

Can somebody help me further or redirect me to the help page (which I was unable to find).


Dennis Hoogendonk
The Netherlands
By: TomH
Date: 2009-07-27
Time: 19:03

Re: Show link in webpage (Google Map code)

Do you mean something like this in your template...
<a href="{a2.Map}">Click here</a>
By: Dennis Hoogendonk
Date: 2009-07-27
Time: 21:36

Re: Show link in webpage (Google Map code)

That's correct. But if use this plain example (i also tried this myself), I don't get the link from the database.


Dennis
By: TomH
Date: 2009-07-28
Time: 00:15

Re: Show link in webpage (Google Map code)

Could you please...
post the actual template code
and
the actual results you get (the browser view source result)
By: Dennis Hoogendonk
Date: 2009-07-28
Time: 10:10

Re: Show link in webpage (Google Map code)

This is the template code - simplified :


<table cellspacing="0" cellpadding="2" border="1">
    <tbody>
        <tr>
        </tr>
        <tr>
            <td bgcolor="#cccccc" class="decal">Naam</td>
            <td bgcolor="#cccccc" class="decal">Plaats</td>
        </tr>
        <tr>
            <td valign="top" class="decal">{a5.Name;block=tr}</td>
            <td valign="top" class="decal">&lt;a href=&quot;{a5.City}&quot;&gt;Click here&lt;/a&gt;</td>
        </tr>
    </tbody>
</table>



And yhis is the result:


<table border="1" cellpadding="2" cellspacing="0">
  <tbody>
    <tr>
      <td class="decal" bgcolor="#cccccc">Name</td>
      <td class="decal" bgcolor="#cccccc">City</td>
    </tr>
    <tr>
      <td class="decal" valign="top">Dennis en Elly Hoogendonk</td>
      <td class="decal" valign="top">&lt;a
href="http://maps.google.nl/maps?f=q&amp;amp;source=s_q&amp;amp;hl=nl&amp;amp;geocode=&amp;amp;q=tolhuislaan+33+etten-leur&amp;amp;sll=52.469397,5.509644&amp;amp;sspn=4.498299,9.656982&amp;amp;ie=UTF8&amp;amp;z=16"&gt;Klik&lt;/a&gt;</td>
    </tr>
  </tbody>
</table>


Obviously HTML code around {a5.City} is converted to text and subsequently the link is not active.

I'm sure there must be a simple workaround but I was unable to find it.


Dennis Hoogendonk
The Netherlands

By: Dennis Hoogendonk
Date: 2009-07-28
Time: 11:02

Re: Show link in webpage (Google Map code)

Well, I found the solution myself.

I edited the TBS section within Joomla's FCK editor in WYSIWYG mode. There '<' and '>' are converted to &gt / &lt which causes the problems.


I got another problem which has nothing to do with TBS. Fields containing Google Maps code convert any '&' to '&amp'. If I retrieve Google Map code from the database, the general map is shown rather than the exact place.

I think I'll have to skip Google Map code from my site !


Dennis Hoogendonk
The Netherlands
By: TomH
Date: 2009-07-28
Time: 12:31

Re: Show link in webpage (Google Map code)

Dennis,

Are you using the "htmlconv=no" parameter in the TBS block code?

See http://www.tinybutstrong.com/manual.php#html_field_prm_htmlconv
By: Dennis Hoogendonk
Date: 2009-07-28
Time: 13:22

Re: Show link in webpage (Google Map code)

Yes, I have tried. But as mentioned before, the problem starts when Google Map link is copied from Joomla's extension 'jUser' to the database. Every '&' is transformed to '&amp;' . If you retrieve this url one gets Google Maps general page.

So it's a problem of jUser.

It could be managed if TBS has a feature to rewrite any '&amp;' to '&' .


Thanks for your interest anyway !


Dennis Hoogendonk
The Netherlands