Commit e0f32703 authored by Bert Leunis's avatar Bert Leunis

ESSENTIALS-1033 change markup of list templates so the result is always a single dom element

parent 9f6eb19a
......@@ -2,29 +2,33 @@
<#-- @ftlvariable name="pageable" type="org.onehippo.cms7.essentials.components.paging.Pageable" -->
<#if pageable?? && pageable.items?has_content>
<#if cparam.showPagination>
<#include "../../include/pagination.ftl">
</#if>
<#list pageable.items as item>
<#if item.title??>
<#assign linkName=item.title>
<#else>
<#assign linkName=item.localizedName>
<div>
<#if cparam.showPagination>
<#include "../../include/pagination.ftl">
</#if>
<article class="has-edit-button">
<@hst.cmseditlink hippobean=item/>
<@hst.link var="link" hippobean=item />
<h3><a href="${link}">${linkName?html}</a></h3>
<#if item.introduction??>
<p>${item.introduction?html}</p>
<#list pageable.items as item>
<#if item.title??>
<#assign linkName=item.title>
<#else>
<#assign linkName=item.localizedName>
</#if>
</article>
</#list>
<#if cparam.showPagination>
<#include "../../include/pagination.ftl">
</#if>
<article class="has-edit-button">
<@hst.cmseditlink hippobean=item/>
<@hst.link var="link" hippobean=item />
<h3><a href="${link}">${linkName?html}</a></h3>
<#if item.introduction??>
<p>${item.introduction?html}</p>
</#if>
</article>
</#list>
<#if cparam.showPagination>
<#include "../../include/pagination.ftl">
</#if>
</div>
<#-- @ftlvariable name="editMode" type="java.lang.Boolean"-->
<#elseif editMode>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/generic-list.png'/>"> Click to edit Generic List
<div>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/generic-list.png'/>"> Click to edit Generic List
</div>
</#if>
......@@ -2,26 +2,30 @@
<#-- @ftlvariable name="pageable" type="org.onehippo.cms7.essentials.components.paging.Pageable" -->
<#if pageable?? && pageable.items?has_content>
<#if cparam.showPagination>
<#include "../../include/pagination.ftl">
</#if>
<#list pageable.items as item>
<#if item.title??>
<#assign linkName=item.title>
<#else>
<#assign linkName=item.localizedName>
<div>
<#if cparam.showPagination>
<#include "../../include/pagination.ftl">
</#if>
<article class="has-edit-button">
<@hst.cmseditlink hippobean=item/>
<@hst.link var="link" hippobean=item />
<h3><a href="${link}">${linkName?html}</a></h3>
<#if item.introduction??>
<p>${item.introduction?html}</p>
<#list pageable.items as item>
<#if item.title??>
<#assign linkName=item.title>
<#else>
<#assign linkName=item.localizedName>
</#if>
</article>
</#list>
<article class="has-edit-button">
<@hst.cmseditlink hippobean=item/>
<@hst.link var="link" hippobean=item />
<h3><a href="${link}">${linkName?html}</a></h3>
<#if item.introduction??>
<p>${item.introduction?html}</p>
</#if>
</article>
</#list>
</div>
<#-- @ftlvariable name="editMode" type="java.lang.Boolean"-->
<#elseif editMode>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/generic-list.png'/>"> Click to edit Generic List
<div>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/generic-list.png'/>"> Click to edit Generic List
</div>
</#if>
......@@ -2,26 +2,30 @@
<#-- @ftlvariable name="pageable" type="org.onehippo.cms7.essentials.components.paging.Pageable" -->
<#if pageable?? && pageable.items?has_content>
<#list pageable.items as item>
<#if item.title??>
<#assign linkName=item.title>
<#else>
<#assign linkName=item.localizedName>
</#if>
<article class="has-edit-button">
<@hst.cmseditlink hippobean=item/>
<@hst.link var="link" hippobean=item />
<h3><a href="${link}">${linkName?html}</a></h3>
<#if item.introduction??>
<p>${item.introduction?html}</p>
<div>
<#list pageable.items as item>
<#if item.title??>
<#assign linkName=item.title>
<#else>
<#assign linkName=item.localizedName>
</#if>
</article>
</#list>
<#if cparam.showPagination>
<#include "../include/pagination.ftl">
</#if>
<article class="has-edit-button">
<@hst.cmseditlink hippobean=item/>
<@hst.link var="link" hippobean=item />
<h3><a href="${link}">${linkName?html}</a></h3>
<#if item.introduction??>
<p>${item.introduction?html}</p>
</#if>
</article>
</#list>
<#if cparam.showPagination>
<#include "../include/pagination.ftl">
</#if>
</div>
<#-- @ftlvariable name="editMode" type="java.lang.Boolean"-->
<#elseif editMode>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/generic-list.png'/>"> Click to edit Generic List
<div>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/generic-list.png'/>"> Click to edit Generic List
</div>
</#if>
<%@ include file="/WEB-INF/jsp/include/imports.jsp" %>
<%--@elvariable id="pageable" type="org.onehippo.cms7.essentials.components.paging.Pageable"--%>
<c:forEach var="item" items="${requestScope.pageable.items}">
<c:choose>
<c:when test="${hst:isReadable(item, 'title')}">
<c:set var="linkName" value="${item.title}"/>
</c:when>
<c:otherwise>
<c:set var="linkName" value="${item.localizedName}"/>
</c:otherwise>
</c:choose>
<c:if test="${(requestScope.pageable ne null) && (not empty requestScope.pageable.items)}">
<div>
<c:forEach var="item" items="${requestScope.pageable.items}">
<c:choose>
<c:when test="${hst:isReadable(item, 'title')}">
<c:set var="linkName" value="${item.title}"/>
</c:when>
<c:otherwise>
<c:set var="linkName" value="${item.localizedName}"/>
</c:otherwise>
</c:choose>
<article class="has-edit-button">
<hst:cmseditlink hippobean="${item}"/>
<hst:link var="link" hippobean="${item}"/>
<h3><a href="${link}"><c:out value="${linkName}"/></a></h3>
<c:if test="${hst:isReadable(item, 'introduction')}">
<p><c:out value="${item.introduction}"/></p>
<article class="has-edit-button">
<hst:cmseditlink hippobean="${item}"/>
<hst:link var="link" hippobean="${item}"/>
<h3><a href="${link}"><c:out value="${linkName}"/></a></h3>
<c:if test="${hst:isReadable(item, 'introduction')}">
<p><c:out value="${item.introduction}"/></p>
</c:if>
</article>
</c:forEach>
<c:if test="${requestScope.cparam.showPagination}">
<%@ include file="/WEB-INF/jsp/include/pagination.jsp" %>
</c:if>
</article>
</c:forEach>
<c:if test="${requestScope.cparam.showPagination}">
<%@ include file="/WEB-INF/jsp/include/pagination.jsp" %>
</div>
</c:if>
<%--@elvariable id="editMode" type="java.lang.Boolean"--%>
<c:if test="${requestScope.editMode and empty requestScope.pageable}">
<img src="<hst:link path='/images/essentials/catalog-component-icons/generic-list.png'/>"> Click to edit Generic List
<div>
<img src="<hst:link path='/images/essentials/catalog-component-icons/generic-list.png'/>"> Click to edit Generic List
</div>
</c:if>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment