Help: generating a hyperlink in query result

Fawcett, David David.Fawcett at STATE.MN.US
Tue Oct 10 15:02:22 EDT 2006


In your query template, you could use the value from one of your
shapefile columns or database columns to build a URL.  
 
Something like:  
 
<a href="http://myserver.com/mydir/[IMAGENAME]">[IMAGENAME]</a>  
 
or 
 
<a
href=http://myserver.com/mydir/[IMAGENUMBER].img>[IMAGENUMBER].img</a>  
 
 
If you wanted to use a URL to send the user directly from a map click to
the image, you could use:
 
TEMPLATE "http://myserver.com/mydir/[IMAGENUMBER].img"  
 
**note, URL templates only work in mode=query, NOT in mode=nquery!
 
David.

	-----Original Message-----
	From: Xiaopeng Xiong [mailto:xpxiong at purdue.edu] 
	Sent: Tuesday, October 10, 2006 1:50 PM
	To: Fawcett, David; MAPSERVER-USERS at lists.umn.edu
	Subject: Re: [UMN_MAPSERVER-USERS] Help: generating a hyperlink
in query result
	
	
	I probably want the second way. A difference is that the
clickable links are not exactly the same as the attribute values in the
index, because I have to change a UNIX file path (e.g.,
/home/MyDir/1.img) to a Web-accessible path (e.g.,
http://SomeWeb/MyDir/1.img).
	 
	 
	Thanks,
	Xiaopeng
	 
	 
	 

		----- Original Message ----- 
		From: Fawcett, David <mailto:David.Fawcett at STATE.MN.US>

		To: MAPSERVER-USERS at LISTS.UMN.EDU 
		Sent: Tuesday, October 10, 2006 2:40 PM
		Subject: Re: [UMN_MAPSERVER-USERS] Help: generating a
hyperlink in query result

		Are you interested in having the user click on the map
and be directed automatically to another Web page?  This could be done
using a URL as a query template and setting the mode to query.  
		 
		Or, do you want the user to click on the map, presumably
as a query and return a page or text on the existing page that includes
a list of clickable links?  
		 
		David.

			-----Original Message-----
			From: UMN MapServer Users List
[mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Xiaopeng Xiong
			Sent: Tuesday, October 10, 2006 1:23 PM
			To: MAPSERVER-USERS at LISTS.UMN.EDU
			Subject: Re: [UMN_MAPSERVER-USERS] Help:
generating a hyperlink in query result
			
			
			Jacob, thank for your reply. 
			I think your method generates hyperlinks after
post-processing of query result. But I wonder if it is possible to
return hyperlinks to a uer directly when he/she clicks on the map. I
wonder it is possible?
			 
			 
			Thanks,
			Xiaopeng
			 
			 

				----- Original Message ----- 
				From: Delfos, Jacob
<mailto:Jacob.Delfos at maunsell.com>  
				To: Xiaopeng Xiong
<mailto:xpxiong at PURDUE.EDU>  ; MAPSERVER-USERS at LISTS.UMN.EDU 
				Sent: Tuesday, October 10, 2006 12:11 AM
				Subject: RE: [UMN_MAPSERVER-USERS] Help:
generating a hyperlink in query result

				Hi Xiaopeng,
				 
				If the attribute value is simply passed
into the HTML, then it's simply a matter of putting in the right HTML
code:
				 
				<a href="http://someWebsite/myDir/1.img"
target=#>Click for 1.img</a>  (the target=# makes it open in a new
window)
				 
				I normally generate a directory listing,
and paste it into a spreadsheet (e.g. excel / openOffice CALC), and
split up the parts of the link, then concatenate them. For example,
imagine a row in a spreadsheet:
				 
				column 1:      <a
href="http://someWebsite/mydir/
				column 2:      1
				column 3:      ".img target=#>
				column 4:      click for image 
				column 5:      1
				column 6:     </a>
				 
				column 7:     =concatenate(column1,
column2, column3, column4, column6)
				 
				Only column 2 and 5 will change (can use
autonumber). All other columns will hold the same value, and can be
copied across.
				 
				Hope this makes sense.
				 
				regards,
				 
				Jacob
				 


________________________________

				From: UMN MapServer Users List
[mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Xiaopeng Xiong
				Sent: 10 October 2006 11:42
				To: MAPSERVER-USERS at LISTS.UMN.EDU
				Subject: [UMN_MAPSERVER-USERS] Help:
generating a hyperlink in query result
				
				
				
				I have one index on raster images and it
can be displayed and queried through Mapserver.
				I wonder whether it would be possible to
generate a hyperlink in query result.
				The hyperlink will be generated based on
one attribute in the index. 
				For example, if the attribute value is
"/home/myDir/1.img", the hyperlink will direct user to
http://SomeWebsite/myDir/1.img".
				I appreciate any suggestions or ideas.
				 
				Thank you
				 
				 
				 
				Best regards,
				Xiaopeng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20061010/eed22492/attachment.html


More information about the mapserver-users mailing list