You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Raible, Matt" <Ma...@cable.comcast.com> on 2003/03/20 19:47:26 UTC

[Tiles] Is it possible to get a definition name in a layout.jsp

I have the following definition in my tiles-config.xml:

    <definition name=".login" extends="baseLayout">
        <put name="title.key"  value="login.title"/>
        <put name="heading.key" value="login.heading"/>
        <put name="content" value="/WEB-INF/pages/welcome.jsp"/>
    </definition>

baseLayout has a path of:

<definition name="baseLayout" path="/layouts/baseLayout.jsp">

In baseLayout.jsp, is it possible to retrieve the definition's name (i.e.
".login").  I'd like to use this in my <body> tag as an id, so after the
login definition is rendered, I'll have:

<body id=".login">

My reason for wanting this is so I can specify minor CSS tweaks on a
per-page basis.  This idea was inspired by
http://diveintomark.org/archives/2003/01/16/body_ids.html.

Thanks,

Matt


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


Re: [Tiles] Is it possible to get a definition name in a layout.jsp

Posted by Cedric Dumoulin <ce...@apache.org>.
  Hi,

  It is not possible in the actual version to retrieve the definition 
name. It is an enhancement request for a next version.
  The workaround is to add an attribute whose value is the definition name.

        Cedric

Raible, Matt wrote:

>I have the following definition in my tiles-config.xml:
>
>    <definition name=".login" extends="baseLayout">
>        <put name="title.key"  value="login.title"/>
>        <put name="heading.key" value="login.heading"/>
>        <put name="content" value="/WEB-INF/pages/welcome.jsp"/>
>    </definition>
>
>baseLayout has a path of:
>
><definition name="baseLayout" path="/layouts/baseLayout.jsp">
>
>In baseLayout.jsp, is it possible to retrieve the definition's name (i.e.
>".login").  I'd like to use this in my <body> tag as an id, so after the
>login definition is rendered, I'll have:
>
><body id=".login">
>
>My reason for wanting this is so I can specify minor CSS tweaks on a
>per-page basis.  This idea was inspired by
>http://diveintomark.org/archives/2003/01/16/body_ids.html.
>
>Thanks,
>
>Matt
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>  
>


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