Author: michiel
Date: 2010-03-18 16:28:10 +0100 (Thu, 18 Mar 2010)
New Revision: 41514
Added:
speeltuin/mihxil/portal/trunk/src/main/resources/META-INF/tags/mm/portal/pages.tagx
Modified:
speeltuin/mihxil/portal/trunk/src/main/resources/META-INF/tags/mm/portal/page.tagx
Log:
added also a 'pages' tag
Modified:
speeltuin/mihxil/portal/trunk/src/main/resources/META-INF/tags/mm/portal/page.tagx
===================================================================
---
speeltuin/mihxil/portal/trunk/src/main/resources/META-INF/tags/mm/portal/page.tagx
2010-03-18 15:08:58 UTC (rev 41513)
+++
speeltuin/mihxil/portal/trunk/src/main/resources/META-INF/tags/mm/portal/page.tagx
2010-03-18 15:28:10 UTC (rev 41514)
@@ -2,6 +2,8 @@
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0"
xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:mm-portal="http://www.mmbase.org/tags/mm/portal"
+ xmlns:mm-portalt="urn:jsptagdir:/WEB-INF/tags/mm/p"
version="2.0"
>
<jsp:directive.tag
@@ -16,23 +18,11 @@
<jsp:directive.variable name-from-attribute="id" alias="page"
variable-class="org.mmbase.bridge.Node" scope="AT_END" />
- <c:choose>
- <c:when test="${empty date}">
- <mm:time id="now" time="now" write="false" />
- </c:when>
- <c:otherwise>
- <mm:time id="now" time="${date}" write="false" />
- </c:otherwise>
- </c:choose>
+ <mm-portal:pages date="${date}">
+ <jsp:attribute name="constraints">
+ <mm:maxnumber value="1" />
+ </jsp:attribute>
+ <mm:node id="page" />
+ </mm-portal:pages>
- <mm:relatednodescontainer type="pages">
- <mm:constraint field="online" operator="lt" value="${now}" />
- <mm:constraint field="offline" operator="gt" value="${now}" />
- <mm:constraint field="show" value="true" />
- <mm:sortorder field="online" direction="down" /> <!-- show the one which
went online most recently -->
- <mm:maxnumber value="1" />
- <mm:relatednodes>
- <mm:node id="page" />
- </mm:relatednodes>
- </mm:relatednodescontainer>
</jsp:root>
Added:
speeltuin/mihxil/portal/trunk/src/main/resources/META-INF/tags/mm/portal/pages.tagx
===================================================================
---
speeltuin/mihxil/portal/trunk/src/main/resources/META-INF/tags/mm/portal/pages.tagx
(rev 0)
+++
speeltuin/mihxil/portal/trunk/src/main/resources/META-INF/tags/mm/portal/pages.tagx
2010-03-18 15:28:10 UTC (rev 41514)
@@ -0,0 +1,44 @@
+<jsp:root
+ xmlns:jsp="http://java.sun.com/JSP/Page"
+ xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ version="2.0"
+ >
+ <jsp:directive.tag
+ description="Calculates the currently to be used page, it looks at
related 'pages' object which are related to the 'current' node" />
+
+ <jsp:directive.attribute
+ name="date"
+ description="the date for which the current page object must be
calculated. Defaults to 'now'. For possible syntaxes see:
+ http://www.mmbase.org/api/org/mmbase/util/DynamicDate.html"
+ />
+ <jsp:directive.attribute fragment="true" name="constraints" />
+
+
+ <c:choose>
+ <c:when test="${empty date}">
+ <mm:time id="now" time="now" write="false" />
+ </c:when>
+ <c:otherwise>
+ <mm:time id="now" time="${date}" write="false" />
+ </c:otherwise>
+ </c:choose>
+ <c:choose>
+ <c:when test="${empty _node}">
+ <mm:listnodescontainer type="pages" id="container" />
+ </c:when>
+ <c:otherwise>
+ <mm:relatednodescontainer type="pages" id="container" />
+ </c:otherwise>
+ </c:choose>
+ <mm:listnodescontainer referid="container">
+ <mm:constraint field="online" operator="lt" value="${now}" />
+ <mm:constraint field="offline" operator="gt" value="${now}" />
+ <mm:constraint field="show" value="true" />
+ <mm:sortorder field="online" direction="down" /> <!-- show the one which
went online most recently -->
+ <jsp:invoke fragment="constraints" />
+ <mm:listnodes>
+ <jsp:doBody />
+ </mm:listnodes>
+ </mm:listnodescontainer>
+</jsp:root>
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs