Hi Amit,
On Friday 09 March 2007 21:43, Amir Mistric wrote:
> Ok after some tweaking based on your idea I came up with
>
> <jsp:scriptlet>
> <![CDATA[
> Content activePage = Resource.getActivePage(request);
> MetaData md = activePage.getMetaData();
> out.write(md.getModificationDate().getTime().toLocaleString());
> // ... or set it for multiple use
> // pageContext.setAttribute("lastModified",
> //md.getModificationDate().getTime().toLocaleString());
> ]]>
> </jsp:scriptlet>
>
> And it does the trick....
>
> Question remains though why not expose MetaData via setNode tag....Seems
> like a logical idea...Something like:
>
> <!-- exposes the current node for use with jstl -->
> <cms:setNode var="currentPage" scope="request"/>
>
> ${currentPage.metaData.lastModified)
>
> I am not a big fan of the scriptlets....:)))
The point is that "currentPage" contains not directly a Content object, but a
Map that wraps the Content object and exposes its properties. You can
use "actpage" though, it is used internally by Magnolia to reference the
actual target page in the request ... ;-)
- Jörg
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------