RE: Need to get a container ID using a taglib
Martin White <[email protected]>
| Newsgroups | gmane.comp.cms.jahia.template |
|---|---|
| Message-ID | <[email protected]> |
Thanks Sergiy. For yours and everyone else's reference, I ended up doing it
like this:
ContainerBean currentContainerBean =
(ContainerBean)pageContext.findAttribute("emplContainer");
JahiaContainer currentContainer = currentContainerBean.getJahiaContainer();
Which is similar but slightly different to your suggestion.
Cheers
Martin
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Monday, 12 June 2006 11:35 p.m.
To: [email protected]
Subject: Re: Need to get a container ID using a taglib
Hello Matin,
probably you have already found the answer on your question. So just in
case, if you still need the info.
The <content:container> tag exposes the current container as an instance of
ContainerBean class under the name, defined in id attribute, into the page
scope.
So you can use it to retrieve the container Id in your JSP (ContainerBean
has a method getId()):
e.g. using JSTL taglib:
<c:out value="${emplContainer.id}"/>
Kind regards.
Sergiy.
Martin White <[email protected]>
12.06.2006 00:35
Please respond to
<[email protected]>
To
"'[email protected]'" <[email protected]>
cc
Subject
Need to get a container ID using a taglib
Hi,
I need to find out the id of a particular container so that I can use it in
a hyperlink. In scriptlets I can do this using the JahiaContainer class'
getID() method. Any idea how I can do this with taglibs?
So for example, in the following I would want to replace <CONTAINER_ID> with
some tag that gives me the unique ID for the current container of type
emplContainer. I can't seem to find anything in the taglib doc that gives me
this.
<content:containerList name="emplContainer" id="emplContainerList">
<content:container id="emplContainer">
<a href="?id=<CONTAINER_ID>"><content:textField
name="emplFirstName"/></a>
</content:container>
</content:containerList>
Thanks
Martin