Matt,
We have solved this in our application by defining our tile as follows
<definition name="baseDef" path="/Template.jsp">
<put name="title" value="My Title1" />
<put name="header" value="/header.jsp"/>
<put name="topnav" value="/topnav.jsp"/>
<put name="leftnav" value="/navigation.jsp"/>
<put name="footer" value="/footer.jsp"/>
<put name="body" value=""/body.jsp>
</definition>
In Template.jsp, you can access title using <tiles.getAsString>
<TITLE><tiles:getAsString name="title"/></TITLE>
Hope this helps.
>>> [EMAIL PROTECTED] 09/25/03 08:51AM >>>
I have an interesting problem that I can't figure out how to solve.
We are using Tiles, as well as a custom tag library that renders
content from Velocity Templates. These templates have HTML content in
them, but they're mostly text - and this is our CMS (for now). The
problem is is that we've developed our app in a way only our menu needs
to know about the templates. So /appName/static/template will show the
template page (wrapped in Tiles). The problem is, by the time I load
the Tile, with the template, the page's title has already been set.
Sure I could use JavaScript and set document.title in the Velocity
template, but that does no good for search engine optimization.
Another solution I thought of is to put the title into the URL in my
menus, i.e.
/appName/static/homeownerServices?title=Homeowner%20Services - but
that's just plain ol' ugly to send as a URL (via e-mail and such).
Two other solutions I can think of:
1. Create a action-mapping and tile for each template (i.e.
/appName/homeownerServices), and define the title in there.
2. Parse the template name and convert it to readable titles. This
would require that I name all my templates so they have an appropriate
title, but it just might work. In this example, /homeownerServices
gets translated to Homeowner Services as a title.
I guess I'll go with #2 (see how simply posting these messages actually
helps to solve things!), but I wanted to see if anyone else had any
good suggestions/practices.
Thanks,
Matt
---------------------------------------------------------------------
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]