|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.magnolia.cms.taglibs.CmsFunctions
public class CmsFunctions
Useful EL functions that can be used in jsp 2.0 pages.
Constructor Summary | |
---|---|
CmsFunctions()
|
Method Summary | |
---|---|
static boolean |
canEdit()
Check if the current user can edit the active page. |
static Content |
currentPage()
Returns the current active page (can be set using the loadPage tag). |
static Content |
currentParagraph()
Returns the current paragraph. |
static boolean |
firstPageWithCollection(String collectionName,
int minlevel)
Find and load the first parent page containing a named collection of nodes. |
static boolean |
firstPageWithNode(String nodeName,
int minlevel)
Find and load the first parent page containing a named node. |
static boolean |
isEditMode()
Check if the current page is open in editing mode. |
static boolean |
isLoggedIn()
Check if a user is currently logged in (not anonymous). |
static String |
link(String handle)
Output a full url given a content handle (usually a page). |
static Content |
mainPage()
Returns the main loaded page (doesn't change when using the loadPage tag). |
static Collection |
nodeDataIterator(Content c,
String collection)
Function to iterate over a node Data that has "checkbox" as control type, for example. |
static Properties |
systemProperties()
Returns the system properties. |
static String |
systemProperty(String key)
Returns the value of a system property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CmsFunctions()
Method Detail |
---|
public static Content currentPage()
public static Content mainPage()
public static Content currentParagraph()
public static String link(String handle)
handle
- page handle
public static String systemProperty(String key)
key
- property key
public static Properties systemProperties()
public static boolean isLoggedIn()
public static boolean canEdit()
public static boolean isEditMode()
public static boolean firstPageWithCollection(String collectionName, int minlevel)
<cms:unloadPage />
tag. Sample use:
<c:if test="${cmsfn:firstPageWithCollection("node", 3)}"> content inherited from page ${cmsfn:currentPage().handle}.html <cms:includeTemplate contentNodeName="node" /> <cms:unloadPage /> </c:if>
collectionName
- paragraph collection nameminlevel
- level at which we will stop also if no page is found
true
if a page has been found and loaded, false
otherwisepublic static boolean firstPageWithNode(String nodeName, int minlevel)
<cms:unloadPage />
tag. Sample use:
<c:if test="${cmsfn:firstPageWithNode("column", 3)}"> content inherited from page ${cmsfn:currentPage().handle}.html <cms:contentNodeIterator contentNodeCollectionName="column"> <cms:includeTemplate /> </cms:contentNodeIterator> <cms:unloadPage /> </c:if>
nodeName
- paragraph nameminlevel
- level at which we will stop also if no page is found
true
if a page has been found and loaded, false
otherwisepublic static Collection nodeDataIterator(Content c, String collection)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |