velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicky thompson <nicky.thomp...@Rightmove.co.uk>
Subject html 'named anchors'in velocity
Date Fri, 04 Oct 2002 18:36:30 GMT
Hello,

I'm a new user (web developer) of velocity on a property portal and am just
getting to grips with various features. I wonder if anyone can help with
this problem.

I'm trying to set up a named anchor, one on each thumbnailed image down the
side of a page, which, when clicked, changes a big image at the top to the
larger version of the thumbnail, and returns to the top of the page where
the large image is.

Here is the code I am trying to use - without the named anchors (please
excuse text wrapping):

#foreach ($image in $Property.images) 
		#if ($MediaMode == 'pictures')
			<p><a
href="$link.setPage("publicsite,$!templatedir,PropertyDetails.vm").addQueryD
ata("p_id", "$Property.Uid.longValue()").addQueryData("pa_n",
$pa_n).addQueryData("MediaMode", "pictures").addQueryData("curr_media_n",
"$k")" onClick="dispImg($k); return false"><img
src="http://$image.nonSecureServer$image.thumbnailUri" width=135
alt="$image.caption" border=0 hspace=5 vspace=5></a><br>
		#else
			<p><a
href="$link.setPage("publicsite,$!templatedir,PropertyDetails.vm").addQueryD
ata("p_id", "$Property.Uid.longValue()").addQueryData("pa_n",
$pa_n).addQueryData("MediaMode", "pictures").addQueryData("curr_media_n",
"$k")"><img src="http://$image.nonSecureServer$image.thumbnailUri" width=135
alt="$image.caption" border=0 hspace=5 vspace=5></a>
		#end

Suspecting that the problem is to do with the fact that a named anchor link
in html uses the code "#thelink", when # is a velocity character, I've tried
escaping the # with a \, but this doesn't work. I've tried various solutions
as follows:

<a
href="$link.setPage("publicsite,$!templatedir,PropertyDetails.vm#top").addQu
eryData ... >
<a
href="$link.setPage("publicsite,$!templatedir,PropertyDetails.vm\#top").addQ
ueryData ... >

which both change the link, as they're supposed to, but don't return me to
the top of the page, and:

<a
href="$link.setPage("publicsite,$!templatedir,PropertyDetails.vm"#top).addQu
eryData ... >
<a
href="$link.setPage("publicsite,$!templatedir,PropertyDetails.vm")\#top.addQ
ueryData ... >

which both break the file, thumbnails.vm (displayed in a pageset (not sure
of the terminology, sorry!) called PropertyDetails.vm. Thumbnails.vm just
doesn't show at all in these last two cases.

I usually try to hang around on lists and help other people before I start
asking for guidance so I feel bad asking for help before getting to know you
all, but I'm suffering under a deadline (who isn't!) and would *really*
appreciate some help with this! Of course, this is not the only problem I'm
having, but it's the only one where I'm really coming to a dead end. argh!

many many thanks if anyone knows about this
cheers
nicky
xx



________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs service. 
________________________________________________________________________
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message