On 9/19/05, Andrew Mason <[EMAIL PROTECTED]> wrote: > Excelent, > Thanks for your help. I think i am doing something slightly wrong though. > > I have this in my menu macro. > > <tr> > <td align="left" width="100%" class="$td_class"> > #set( $link = $menuItem.getLink() ) > #set( $link = "$link" ) > <a href="$link" class="z_menu" >$!menuItem.getText()</a> > </td> > </tr> > > > and in the database i have > > edit?pageId=$current.getId() > > this still prints out that way instead of > > edit?pageId=142 > > What am i doing wrong?
i'm not sure. i'll admit, i haven't test the solution i gave you. still, i think it should work. i'm curious, does the $menuitem.getLink() method return a String? if it doesn't, try this: #set( $link = $menuitem.getLink().toString() ) #set( $link = "$link" ) also, be sure that you either do not change the runtime.interpolate.string.literals property in your velocity.properties, or if you do specify a value, that it is true (the default). > On Sun September 18 2005 4:24 pm, Nathan Bubna wrote: > > oh, i should also point out this this could be done as follows: > > > > #set( $link = $menu.getLink() > > > #set( $link = "$link" > > > > > though i find that more confusing than using either the RenderTool or > > the ViewRenderTool (the latter is best if you are using the > > VelocityViewServlet). > > > > On 9/18/05, Nathan Bubna <[EMAIL PROTECTED]> wrote: > > > http://jakarta.apache.org/velocity/tools/javadoc/org/apache/velocity/tool > > >s/generic/RenderTool.html > > > > > > On 9/18/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I've got a template which basically shows a result from a database, > > > > e.g: > > > > > > > > > > > > <span> > > > > <a href="$menu.getLink()">$menu.getText()</a> > > > > </span> > > > > > > > > which works great. Only problem is that, the $menu.getLink() returned > > > > from the db is something like > > > > > > > > /editPage?pageId=$pageId > > > > > > > > $pageId is available to the page and if i put it in the actual .vm file > > > > it will appear. Is there anyway to tell velocity to attempt to do its > > > > substitution on the result of a substitution? > > > > > > > > so $menu.getLink(); > > > > would then appear as /editPage?pageId=4 > > > > Can i just use #parse($menu.getLink()) > > > > > > > > thanks > > > > Andrew > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]