1

I have BGS 50k vector data which includes a field referring to the LEX code on the BGS website. Obviously the web address will be unique for every geological formation so I need to insert the field into the map tips window.

I have laid out the information in table format which is why I have <tr> and <td> tags. I have tried typing the following with no success.

<tr><td class="bold">BGS Link:</td><td><a href="[% "LEX_WEB" %]"></a></td></tr>

or

<tr><td class="bold">BGS Link:</td><td><a href=[% "LEX_WEB" %]></a></td></tr>

and

<tr><td class="bold">BGS Link:</td><a href=<td>"[% "LEX_WEB" %]"></td></a></tr>

or

<tr><td class="bold">BGS Link:</td><a href=<td>[% "LEX_WEB" %]></td></a></tr> 

The last two produce the hyperlink at the very top of the map tip but when clicking it, my web browser does not follow it. Strange thing, I can't even reproduce the hyperlink outside the table format!

If you are keen to test it out I have left the my table styling below. I propose setting up a shapefile with a 'Link' field and entering something like 'www.google.com'.

<style> 
body { 
background-color: white!important; 
font-family: sans-serif; 
width: 200px; 
} 

table { 
border-collapse: collapse; 
} 

th { 
font-size: 15px; 
text-transform: uppercase; 
padding: 10px; 
background: #006c1c; 
color: white; 
} 

tr { 
border: 2px solid white; 
} 

tr:nth-child (odd) { 
background:grey!important; 
} 

td { 
font-size: 12px; 
white-space: nowrap; 
padding: 5px; 
background:#eaeaea; 
} 

td.h2{ 
font-size: 15px; 
float: left!important; 
font-weight: bold; 
background:grey; 
color:white; 
} 

td.bold { 
font-size: 12px; 
font-weight: bold; 
} 
td.gap { 
background-color:white; 
padding:1px; 
} 
</style> 
2

None of your attempts at HTML are actually going to create a link.

Try something like:

 <a href="http://google.com?q=[% "STATE_NAME" %]">[% "STATE_NAME" %]</a>

Where you add the field to the URL AND provide some text to link to, in this case the state name field but it could be a simple text string like link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.