Read a property of an arbitrary CmsResource

(Difference between revisions)
Jump to: navigation, search
 
Line 10: Line 10:
 
       boolean search = false;
 
       boolean search = false;
 
       CmsProperty prop = cms.readPropertyObject("/sites/mysite/my_path/file.ext", "prop_name", search);
 
       CmsProperty prop = cms.readPropertyObject("/sites/mysite/my_path/file.ext", "prop_name", search);
 
+
     
 
       String propValue = (prop != null) ? prop.getValue() : null;
 
       String propValue = (prop != null) ? prop.getValue() : null;
 
   %>
 
   %>

Revision as of 07:46, 13 May 2007

With scriptlets, you can read the properties of any opencms resource.


  <%@page import="org.opencms.file.CmsProperty"%>
  <%
     CmsObject cms;
     
     // .. get the cms object
     
     boolean search = false;
     CmsProperty prop = cms.readPropertyObject("/sites/mysite/my_path/file.ext", "prop_name", search);
     
     String propValue = (prop != null) ? prop.getValue() : null;
  %>
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox