You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Luke Majewski <lu...@comcast.net> on 2003/11/13 00:44:46 UTC

anchor from backend

Hi all,

I'm trying to use my backend to access a template file "Something.vm" but I want to add an anchor to the call.  Is there something you can add to the setTemplate call to accomplish this?  if I go "setTemplate.vm#anchor" it obviously says that no such form exists.  I found this post that seemed to be relevant, but not entirely sure.

http://www.mail-archive.com/turbine-user@jakarta.apache.org/msg01050.html

Also, is there some sort of workaround maybe?

I could do it this way directly from a vm file

<a href="$link.setPage("publicsite,Sitefaq.vm")#shortName">Click here</a>

Can I access whatever the "$link" object is from the backend?  If so, what class does $link belong to?  I've looked in the javadocs and all the setPage actions are deprecated that seem to be relevant for me.  In any case, any help here would be greatly appreciated.

Thank you!

Luke Majewski

Re: anchor from backend

Posted by Luke Majewski <lu...@comcast.net>.
Thank you for the reply Greg,

> Why not pass the extra information as a parameter or a temp variable,
> instead of an anchor? Then you can catch the condition in the template,
and
> display the appropriate information.

unfortunately I'm actually trying to use the #anchor tag on a velocity form,
I'm not sure if this was understood.   I know how to pass a parameter to the
form or stick something in the context, but I'm actually trying to get the
anchor behavior here.  To briefly explain, I have a large tree that gets
expanded and collapsed based on some back end manipulation.  Well, when the
backend does it's work, it goes back to the screen with the tree on it.
What I've done is set anchor tags at each node of the tree, so when I click
on the node I know what node to go back to when I return to the page.

So I have something like

#foreach ($item in $clippedCategories)
    <a name="anchor_$velocityCount"></a>
    display node and other stuff here
#end

So I want to be able to call this form with a "#anchor_1025" or something
like that.  The tree is going to have thousands of elements, and when a
person has scrolled halfway down the tree and clicks on something, I want
the form to return to the to that anchor point.  I have everything working
except I can't get the template to have a #anchor after it.  If I enter it
manually at the top of the page it works fine.  Does this help at all in
explaining what I am trying to do?

Thank you,

Luke

----- Original Message -----
From: "Greg Kerdemelidis" <gk...@snap.net.nz>
To: "'Turbine Users List'" <tu...@jakarta.apache.org>
Sent: Thursday, November 13, 2003 11:08 PM
Subject: RE: anchor from backend


>
> I'm not too clear on what you require here, Luke. Are you trying to
> programmatically redirect to an anchor in a particular page from your
code?
>
> Why not pass the extra information as a parameter or a temp variable,
> instead of an anchor? Then you can catch the condition in the template,
and
> display the appropriate information.
>
> The link tool is a request tool:
> org.apache.turbine.util.template.TemplateLink.
>
> Programmatically redirecting the user to different pages is generally done
> thusly (from an action or a screen class):
>
> Data.setScreenTemplate("blah");
>
> Is that what you're doing?
>
> Regards,
>
> -Greg
>
> > -----Original Message-----
> > From: Luke Majewski [mailto:luke.majewski@comcast.net]
> > Sent: Thursday, 13 November 2003 12:45 p.m.
> > To: turbine-user@jakarta.apache.org
> > Subject: anchor from backend
> >
> > Hi all,
> >
> > I'm trying to use my backend to access a template file "Something.vm"
but
> > I want to add an anchor to the call.  Is there something you can add to
> > the setTemplate call to accomplish this?  if I go
"setTemplate.vm#anchor"
> > it obviously says that no such form exists.  I found this post that
seemed
> > to be relevant, but not entirely sure.
> >
> >
http://www.mail-archive.com/turbine-user@jakarta.apache.org/msg01050.html
> >
> > Also, is there some sort of workaround maybe?
> >
> > I could do it this way directly from a vm file
> >
> > <a href="$link.setPage("publicsite,Sitefaq.vm")#shortName">Click
here</a>
> >
> > Can I access whatever the "$link" object is from the backend?  If so,
what
> > class does $link belong to?  I've looked in the javadocs and all the
> > setPage actions are deprecated that seem to be relevant for me.  In any
> > case, any help here would be greatly appreciated.
> >
> > Thank you!
> >
> > Luke Majewski
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: anchor from backend

Posted by Greg Kerdemelidis <gk...@snap.net.nz>.
I'm not too clear on what you require here, Luke. Are you trying to
programmatically redirect to an anchor in a particular page from your code?

Why not pass the extra information as a parameter or a temp variable,
instead of an anchor? Then you can catch the condition in the template, and
display the appropriate information.

The link tool is a request tool:
org.apache.turbine.util.template.TemplateLink.

Programmatically redirecting the user to different pages is generally done
thusly (from an action or a screen class):

Data.setScreenTemplate("blah");

Is that what you're doing?

Regards,

-Greg

> -----Original Message-----
> From: Luke Majewski [mailto:luke.majewski@comcast.net]
> Sent: Thursday, 13 November 2003 12:45 p.m.
> To: turbine-user@jakarta.apache.org
> Subject: anchor from backend
> 
> Hi all,
> 
> I'm trying to use my backend to access a template file "Something.vm" but
> I want to add an anchor to the call.  Is there something you can add to
> the setTemplate call to accomplish this?  if I go "setTemplate.vm#anchor"
> it obviously says that no such form exists.  I found this post that seemed
> to be relevant, but not entirely sure.
> 
> http://www.mail-archive.com/turbine-user@jakarta.apache.org/msg01050.html
> 
> Also, is there some sort of workaround maybe?
> 
> I could do it this way directly from a vm file
> 
> <a href="$link.setPage("publicsite,Sitefaq.vm")#shortName">Click here</a>
> 
> Can I access whatever the "$link" object is from the backend?  If so, what
> class does $link belong to?  I've looked in the javadocs and all the
> setPage actions are deprecated that seem to be relevant for me.  In any
> case, any help here would be greatly appreciated.
> 
> Thank you!
> 
> Luke Majewski


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org