Re: Need to get a container ID using a taglib

[email protected]
Newsgroups gmane.comp.cms.jahia.template
Message-ID <OF61F31C63.AE5C7CDB-ONC125718B.003DC9BC-C125718B.003FA017@commaro.com>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.