[opencms-dev] Selective display of Structured Content
Stephane Bourbonnais
sbourbonnais at nonlinear.ca
Tue May 27 22:53:10 CEST 2008
Hi,
I have structured content for "stories" on my site. I have a field in the xml for the "type" of story. I want to use contentload to pull all the stories in of a certain type (or types), but when I use the code below I get a bunch of "direct edit" images/code on my page for items I chose not to show. Is there ANY way (outside of building my own collector) to get this to work properly?
Is there a way I can remove items from a I_CmsXmlContentcontainer?
Is there a way I can manually put the "direct edit" buttons in if I set the contentload value for editable to "false"?
<%
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);
CmsJspXmlContentBean cmsXmlBean = new CmsJspXmlContentBean(pageContext, request, response);
I_CmsXmlContentContainer container = cmsXmlBean.contentload("allInFolderDateReleasedDesc", cms.getRequestContext().getFolderUri() + "story_%(number).html|story", cms.getRequestContext().getLocale(), true);
while(container.hasMoreContent()) {
if (cmsXmlBean.contentshow(container, "Type").equals("1")) {
out.print(cmsXmlBean.contentshow(container, "Title"));
}
}
%>
Any help would be greatly appreciated. Thanks!
Stephane Bourbonnais
non-linear creations inc.
987A Wellington St., Suite 201, Ottawa, Ontario, Canada, K1Y 2Y1
tel: 613.241.2067 ext: 264 fax: 613.241.3086
http://www.nonlinear.ca<http://www.nonlinear.ca/> | sbourbonnais at nonlinear.ca<mailto:sbourbonnais at nonlinear.ca>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20080527/dedb4b39/attachment.htm>
More information about the opencms-dev
mailing list