Using html:link inside a logic:iterate loop
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   David_Swearingen
Posted On:   Thursday, January 22, 2004 09:34 AM

I am creating a navigation menu from a Vector, where each object in the vector represents a navigation link, and contains the link text, and the link url. I am using logic:iterate, and inside this loop I need to construct the clickable link for each menu item. So I suppose I need the html:link tag, but then inside it I need to generate both the visible text for the link, and the url target for the link. Right now I am doing it the ugly way with the anchor tag and bean:write's, since I assumed or recalled from past experience that you cannot nest a bean:write inside of an html:link. Is there a better, cleaner way to do this? I want to use html:link because of the features it offers. My Vector contains an object with two get'ers; one get retrie   More>>

I am creating a navigation menu from a Vector, where each object in the vector represents a navigation link, and contains the link text, and the link url. I am using logic:iterate, and inside this loop I need to construct the clickable link for each menu item. So I suppose I need the html:link tag, but then inside it I need to generate both the visible text for the link, and the url target for the link. Right now I am doing it the ugly way with the anchor tag and bean:write's, since I assumed or recalled from past experience that you cannot nest a bean:write inside of an html:link.


Is there a better, cleaner way to do this? I want to use html:link because of the features it offers.


My Vector contains an object with two get'ers; one get retrieves the link visible text, the other retrieves the url target.

(I tried to post the source but couldn't get some of the html to escape properly.) Thanks.    <<Less

Re: Using html:link inside a logic:iterate loop

Posted By:   Christopher_Koenigsberg  
Posted On:   Friday, January 23, 2004 06:44 AM

I think there is no problem writing " " e.g. a bean:write in the body of an html:link tag, as long as you don't try to use the bean:write inside an attribute of the html:link tag?

About | Sitemap | Contact