[opencms-dev] (Current) Folder title (solved)

Daniel Frost daniel.frost at crossroadsinteractive.se
Thu Sep 16 13:20:27 CEST 2004


This is what I just got working:

<%@ page import="com.opencms.flex.jsp.*" %>
<%@ page session="true" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<%@ page import="java.util.*,com.opencms.flex.jsp.*" %>

<%
// Create a JSP action element
							
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
response);

String currentFolder =
cms.getRequestContext().currentFolder().getAbsolutePath();
String currentFolderTitle = "";

CmsJspNavElement element = null; 
element = cms.getNavigation().getNavigationForResource(currentFolder);

if (element.isInNavigation()) {
   currentFolderTitle = element.getTitle();        
}


%>

Thanks to everyone who replied!


-----Original Message-----
From: Olli Aro [mailto:olli_aro at yahoo.co.uk] 
Sent: den 16 september 2004 07:19
To: 'Daniel Frost'; 'The OpenCms mailing list'
Subject: RE: [opencms-dev] Folder title

Aaah, your cms is not actually CmsObject but CmsJspActionElement. Try:

CmsObject cmso=cms.getCmsObject();
String currentFolderTitle = cmso.readProperty(cmso. getAbsolutePath,
"Title");

-----Original Message-----
From: Daniel Frost [mailto:daniel.frost at crossroadsinteractive.se] 
Sent: 16 September 2004 01:12
To: olli_aro at yahoo.co.uk; 'The OpenCms mailing list'
Subject: RE: [opencms-dev] Folder title

getAbsolutePath() and getPath() gives me the same results, ie.
"/www/drule/".

I can't get cms.readProperty to work, even when trying with the following
examples:

String currentFolderTitle = cms.readProperty("/www/drule/", "Title");
or
String currentFolderTitle = cms.readProperty("/www/drule", "Title");

I'm obviously using readProperty wrong, the error is "cannot resolve symbol
symbol : method readProperty (java.lang.String,java.lang.String) location:
class com.opencms.flex.jsp.CmsJspActionElement".

Isn't there a quick & easy way of reading the current folder's title?


> -----Original Message-----
> From: opencms-dev-bounces at opencms.org 
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Olli Aro
> Sent: den 15 september 2004 16:13
> To: 'The OpenCms mailing list'
> Subject: RE: [opencms-dev] Folder title
> 
> Or capital T for the title attribute
> 
> String currentFolderTiltle = cms.readProperty(currentFolder, "Title");
> 
> Olli
> 
> -----Original Message-----
> From: opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Vincent Hanniet
> Sent: 15 September 2004 14:30
> To: The OpenCms mailing list
> Subject: Re: [opencms-dev] Folder title
> 
> Hi,
> Try getPath() instead of getAbsolutePath().
> HTH
> Vincent
> 
> Daniel Frost wrote:
> 
> >I'm trying the followin to read the current folder's title:
> >
> >
> >String currentFolder =
> >cms.getRequestContext().currentFolder().getAbsolutePath();
> >
> >String currentFolderTiltle = cms.readProperty(currentFolder, 
> "title");
> >
> >The first line works, but the second gives me an error. 
> >
> >What's wrong?
> >
> >
> >
> >
> >_______________________________________________
> >This mail is send to you from the opencms-dev mailing list To change 
> >your list options, or to unsubscribe from the list, please visit 
> >http://mail.opencms.org/mailman/listinfo/opencms-dev
> >
> >
> >  
> >
> 
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list To 
> change your list options, or to unsubscribe from the list, 
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.756 / Virus Database: 506 - Release Date: 08/09/2004
>  
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.756 / Virus Database: 506 - Release Date: 08/09/2004
>  
> 
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list To 
> change your list options, or to unsubscribe from the list, 
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> 

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.756 / Virus Database: 506 - Release Date: 08/09/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.756 / Virus Database: 506 - Release Date: 08/09/2004
 




More information about the opencms-dev mailing list