Hi Lynn,<br><br>the cms:titleTag was a hypotethical proposal in my original question.<br><br>Try to use cms:property, that does what you need:<br><br>
<cms:property name='Title' file='/en/sitemap.html' /> or<br>
<cms:property name='Title' file='${myVar}' /><br>
<br>read more about it here:<br><a href="http://www.bng-galiza.org/opencms/opencms/alkacon-documentation/documentation_taglib/docu_tag_property.html">http://www.bng-galiza.org/opencms/opencms/alkacon-documentation/documentation_taglib/docu_tag_property.html</a><br>
<br>yves<br><br><div class="gmail_quote">On 21 April 2010 04:00, chapmanl99 <span dir="ltr"><<a href="mailto:chapmanl99@aol.com">chapmanl99@aol.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
I would like to use this code but give it a variable containing the filename.<br>
I'm trying to produce a list of files in a folder using the Title property<br>
of each file. There are several code examples on the web but none that I<br>
can find work correctly. This is what I have so far. I used your suggestion<br>
for the two cms tagTitle lines but they produce an error.<br>
<br>
<%@ page session="false" buffer="none" import="java.sql.*, com.onr.*,<br>
java.util.*,org.opencms.search.*, org.opencms.flex.*, org.opencms.util.*,<br>
org.opencms.jsp.*, org.opencms.frontend.templateone.modules.*,<br>
org.opencms.main.*, org.opencms.file.*" %><br>
<%@ taglib prefix="cms" uri="<a href="http://www.opencms.org/taglib/cms" target="_blank">http://www.opencms.org/taglib/cms</a>" %><br>
<jsp:useBean id="cmsUser" class="org.opencms.jsp.CmsJspActionElement"><br>
<% cmsUser.init(pageContext, request, response); %><br>
</jsp:useBean><br>
<%<br>
<br>
CmsJspActionElement action = new<br>
CmsJspActionElement(pageContext,request,response);<br>
CmsObject cms = action.getCmsObject();<br>
<br>
try {<br>
<br>
List listFolders =<br>
cms.getSubFolders(<a href="http://action.info" target="_blank">action.info</a>("opencms.request.folder"));<br>
CmsFolder cmsfolder= null;<br>
for(int i=0;i<listFolders.size();i++){<br>
cmsfolder=(CmsFolder) listFolders.get(i);<br>
%><br>
"<cms:link /<%=cmsfolder.getName()%></cms:link>"><%=cmsfolder.getName()%><br>
<% out.println("<br>");<br>
}<br>
<br>
List listFiles =<br>
cms.getFilesInFolder(<a href="http://action.info" target="_blank">action.info</a>("opencms.request.folder"));<br>
for(int i=0;i<listFiles.size();i++){<br>
CmsFile cmsfile= (CmsFile) listFiles.get(i);<br>
String propertyname = "title";<br>
String filename = cmsfile.getName();<br>
%><br>
<br>
<cms:titleTag file='site-event-reporting.jsp'/><br>
<cms:titleTag file = filename/><br>
<br>
<br>
"<cms:link /<%=cmsfile.getName()%></cms:link>"><%=cmsfile.getName()%><br>
<% out.println("<br>");<br>
}<br>
<br>
} catch (CmsException e) {<br>
out.println(e);<br>
}<br>
%><br>
<br>
These two lines in the middle of the code:<br>
<cms:titleTag file='site-event-reporting.jsp'/><br>
<cms:titleTag file = filename/><br>
<br>
do not work for me. I get "No tag "titleTag" defined in the library<br>
imported with prefix cms" error. I'm using opencms 6. Could that be the<br>
problem. I would appreciate any help with this.<br>
Lynn<br>
<div><div></div><div class="h5"><br>
<br>
<br>
Yves Glodt-5 wrote:<br>
><br>
> On Wednesday 18 February 2009, Yves Glodt wrote:<br>
>> Hello,<br>
>><br>
>> is there a way to get the title of a resource with an opencms tag, à la<br>
>> <cms:titleTag file="/folder/file.html" /> ?<br>
><br>
> Fool, of course it is!<br>
><br>
> <cms:property name='Title' file='/en/sitemap.html' /><br>
><br>
> doc-reading helps... :-)<br>
><br>
>> best regards,<br>
>> Yves<br>
>><br>
>><br>
>> _______________________________________________<br>
>> This mail is sent to you from the opencms-dev mailing list<br>
>> To change your list options, or to unsubscribe from the list, please<br>
>> visit<br>
>> <a href="http://lists.opencms.org/mailman/listinfo/opencms-dev" target="_blank">http://lists.opencms.org/mailman/listinfo/opencms-dev</a><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> This mail is sent to you from the opencms-dev mailing list<br>
> To change your list options, or to unsubscribe from the list, please visit<br>
> <a href="http://lists.opencms.org/mailman/listinfo/opencms-dev" target="_blank">http://lists.opencms.org/mailman/listinfo/opencms-dev</a><br>
><br>
<br>
</div></div><font color="#888888">--<br>
View this message in context: <a href="http://old.nabble.com/get-title-of-resource-with-jstl-tp22080788p28287942.html" target="_blank">http://old.nabble.com/get-title-of-resource-with-jstl-tp22080788p28287942.html</a><br>
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.<br>
</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
This mail is sent to you from the opencms-dev mailing list<br>
To change your list options, or to unsubscribe from the list, please visit<br>
<a href="http://lists.opencms.org/mailman/listinfo/opencms-dev" target="_blank">http://lists.opencms.org/mailman/listinfo/opencms-dev</a></div></div></blockquote></div><br>