Commit b2c336b8 authored by Bert Leunis's avatar Bert Leunis

ESSENTIALS-1033 change markup of news plugin templates so the result is always...

ESSENTIALS-1033 change markup of news plugin templates so the result is always a single dom element (2 have only layout changes)
parent 54a6094f
......@@ -4,36 +4,40 @@
<#-- @ftlvariable name="pageable" type="org.onehippo.cms7.essentials.components.paging.Pageable" -->
<#-- @ftlvariable name="cparam" type="org.onehippo.cms7.essentials.components.info.EssentialsNewsComponentInfo" -->
<#if pageable?? && pageable.items?has_content>
<div>
<#list pageable.items as item>
<@hst.link var="link" hippobean=item />
<@hst.cmseditlink hippobean=item/>
<@hst.link var="link" hippobean=item />
<@hst.cmseditlink hippobean=item/>
<div class="media">
<div class="media-left" style="float: left">
<a href="${link}">
<#if item.image?? && item.image.thumbnail??>
<@hst.link var="img" hippobean=item.image.thumbnail/>
<img src="${img}" title="${item.image.fileName?html}" alt="${item.image.fileName?html}"/>
</#if>
</a>
</div>
<div class="media-body">
<h4 class="media-heading"><a href="${link}">${item.title?html}</a>
<span class="label label-success pull-right">
<#if item.date?? && item.date.time??>
<@fmt.formatDate value=item.date.time type="both" dateStyle="medium" timeStyle="short"/>
</#if>
</span>
</h4>
<p>${item.introduction?html}</p>
</div>
<div class="media-left" style="float: left">
<a href="${link}">
<#if item.image?? && item.image.thumbnail??>
<@hst.link var="img" hippobean=item.image.thumbnail/>
<img src="${img}" title="${item.image.fileName?html}" alt="${item.image.fileName?html}"/>
</#if>
</a>
</div>
<div class="media-body">
<h4 class="media-heading"><a href="${link}">${item.title?html}</a>
<span class="label label-success pull-right">
<#if item.date?? && item.date.time??>
<@fmt.formatDate value=item.date.time type="both" dateStyle="medium" timeStyle="short"/>
</#if>
</span>
</h4>
<p>${item.introduction?html}</p>
</div>
</div>
</#list>
<#if cparam.showPagination>
<#include "../../include/pagination.ftl">
<#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/news-list.png'/>"> Click to edit News List
<div>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/news-list.png'/>"> Click to edit News List
</div>
</#if>
......@@ -3,24 +3,28 @@
<#-- @ftlvariable name="item" type="{{beansPackage}}.NewsDocument" -->
<#-- @ftlvariable name="pageable" type="org.onehippo.cms7.essentials.components.paging.Pageable" -->
<#if pageable?? && pageable.items?has_content>
<div>
<#list pageable.items as item>
<@hst.link var="link" hippobean=item />
<article class="has-edit-button">
<@hst.link var="link" hippobean=item />
<article class="has-edit-button">
<@hst.cmseditlink hippobean=item/>
<h3><a href="${link}">${item.title?html}</a></h3>
<#if item.date?? && item.date.time??>
<p><@fmt.formatDate value=item.date.time type="both" dateStyle="medium" timeStyle="short"/></p>
<p><@fmt.formatDate value=item.date.time type="both" dateStyle="medium" timeStyle="short"/></p>
</#if>
<p>${item.location?html}</p>
<p>${item.introduction?html}</p>
</article>
</article>
</#list>
<#if cparam.showPagination>
<#include "../include/pagination.ftl">
<#include "../include/pagination.ftl">
</#if>
</div>
<#-- @ftlvariable name="editMode" type="java.lang.Boolean"-->
<#elseif editMode>
<div>
<img src="<@hst.link path='/images/essentials/catalog-component-icons/news-list.png'/>"> Click to edit News List
</div>
</#if>
......@@ -2,22 +2,22 @@
<#-- @ftlvariable name="document" type="{{beansPackage}}.NewsDocument" -->
<#if document??>
<@hst.link var="link" hippobean=document/>
<article class="has-edit-button">
<@hst.link var="link" hippobean=document/>
<article class="has-edit-button">
<@hst.cmseditlink hippobean=document/>
<h3><a href="${link}">${document.title?html}</a>
<#if document.date??>
<small><@fmt.formatDate value=document.date.time type="date" dateStyle="medium"/></small>
</#if>
<#if document.date??>
<small><@fmt.formatDate value=document.date.time type="date" dateStyle="medium"/></small>
</#if>
</h3>
<#if document.introduction??>
<p class="lead">${document.introduction?html}</p>
<p class="lead">${document.introduction?html}</p>
</#if>
<@hst.html hippohtml=document.content/>
<#if document.author??>
<footer>
<p>-- by <em>${document.author?html}</em></p>
</footer>
<footer>
<p>-- by <em>${document.author?html}</em></p>
</footer>
</#if>
</article>
</article>
</#if>
\ No newline at end of file
......@@ -2,37 +2,37 @@
<#-- @ftlvariable name="document" type="{{beansPackage}}.NewsDocument" -->
<#if document??>
<@hst.link var="link" hippobean=document/>
<article class="has-edit-button">
<@hst.link var="link" hippobean=document/>
<article class="has-edit-button">
<@hst.cmseditlink hippobean=document/>
<h3><a href="${link}">${document.title?html}</a></h3>
<#if document.date??>
<p><@fmt.formatDate value=document.date.time type="both" dateStyle="medium" timeStyle="short"/></p>
<p><@fmt.formatDate value=document.date.time type="both" dateStyle="medium" timeStyle="short"/></p>
</#if>
<#if document.endDate??>
<p><@fmt.formatDate value=document.endDate.time type="both" dateStyle="medium" timeStyle="short"/></p>
<p><@fmt.formatDate value=document.endDate.time type="both" dateStyle="medium" timeStyle="short"/></p>
</#if>
<#if document.author??>
<p>${document.author?html}</p>
<p>${document.author?html}</p>
</#if>
<#if document.source??>
<p>${document.source?html}</p>
<p>${document.source?html}</p>
</#if>
<#if document.location??>
<p>${document.location?html}</p>
<p>${document.location?html}</p>
</#if>
<#if document.introduction??>
<p>${document.introduction?html}</p>
<p>${document.introduction?html}</p>
</#if>
<#if document.image?? && document.image.original??>
<@hst.link var="img" hippobean=document.image.original/>
<figure>
<img src="${img}" title="${document.image.fileName?html}" alt="${document.image.fileName?html}"/>
<#if document.image.description??>
<figcaption>${document.image.description?html}</figcaption>
</#if>
</figure>
<@hst.link var="img" hippobean=document.image.original/>
<figure>
<img src="${img}" title="${document.image.fileName?html}" alt="${document.image.fileName?html}"/>
<#if document.image.description??>
<figcaption>${document.image.description?html}</figcaption>
</#if>
</figure>
</#if>
<@hst.html hippohtml=document.content/>
</article>
</article>
</#if>
\ No newline at end of file
......@@ -3,23 +3,29 @@
<%--@elvariable id="item" type="{{beansPackage}}.NewsDocument"--%>
<%--@elvariable id="pageable" type="org.onehippo.cms7.essentials.components.paging.Pageable"--%>
<c:forEach var="item" items="${requestScope.pageable.items}" varStatus="status">
<hst:link var="link" hippobean="${item}"/>
<article class="has-edit-button">
<hst:cmseditlink hippobean="${item}"/>
<h3><a href="${link}"><c:out value="${item.title}"/></a></h3>
<c:if test="${hst:isReadable(item, 'date.time')}">
<p>
<fmt:formatDate value="${item.date.time}" type="both" dateStyle="medium" timeStyle="short"/>
</p>
<c:if test="${not empty requestScope.pageable}">
<div>
<c:forEach var="item" items="${requestScope.pageable.items}" varStatus="status">
<hst:link var="link" hippobean="${item}"/>
<article class="has-edit-button">
<hst:cmseditlink hippobean="${item}"/>
<h3><a href="${link}"><c:out value="${item.title}"/></a></h3>
<c:if test="${hst:isReadable(item, 'date.time')}">
<p>
<fmt:formatDate value="${item.date.time}" type="both" dateStyle="medium" timeStyle="short"/>
</p>
</c:if>
<p><c:out value="${item.introduction}"/></p>
</article>
</c:forEach>
<c:if test="${requestScope.cparam.showPagination}">
<%@ include file="/WEB-INF/jsp/include/pagination.jsp" %>
</c:if>
<p><c:out value="${item.introduction}"/></p>
</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/news-list.png'/>"> Click to edit News List
<div>
<img src="<hst:link path='/images/essentials/catalog-component-icons/news-list.png'/>"> Click to edit News List
</div>
</c:if>
\ No newline at end of file
<%@ include file="/WEB-INF/jsp/include/imports.jsp" %>
<%--@elvariable id="document" type="{{beansPackage}}.NewsDocument"--%>
<c:if test="${not empty requestScope.document}">
<hst:link var="link" hippobean="${requestScope.document}"/>
<article class="has-edit-button">
<hst:cmseditlink hippobean="${requestScope.document}"/>
<h3><a href="${link}"><c:out value="${requestScope.document.title}"/></a></h3>
<c:if test="${hst:isReadable(requestScope.document, 'date.time')}">
<p>
<fmt:formatDate value="${requestScope.document.date.time}" type="both" dateStyle="medium" timeStyle="short"/>
</p>
</c:if>
<hst:link var="link" hippobean="${requestScope.document}"/>
<article class="has-edit-button">
<hst:cmseditlink hippobean="${requestScope.document}"/>
<h3><a href="${link}"><c:out value="${requestScope.document.title}"/></a></h3>
<c:if test="${hst:isReadable(requestScope.document, 'date.time')}">
<p>
<fmt:formatDate value="${requestScope.document.date.time}" type="both" dateStyle="medium" timeStyle="short"/>
</p>
</c:if>
<c:if test="${not empty requestScope.document.author}">
<p><c:out value="${requestScope.document.author}"/></p>
</c:if>
<c:if test="${not empty requestScope.document.source}">
<p><c:out value="${requestScope.document.source}"/></p>
</c:if>
<c:if test="${not empty requestScope.document.location}">
<p><c:out value="${requestScope.document.location}"/></p>
</c:if>
<c:if test="${not empty requestScope.document.author}">
<p><c:out value="${requestScope.document.author}"/></p>
</c:if>
<c:if test="${not empty requestScope.document.source}">
<p><c:out value="${requestScope.document.source}"/></p>
</c:if>
<c:if test="${not empty requestScope.document.location}">
<p><c:out value="${requestScope.document.location}"/></p>
</c:if>
<c:if test="${not empty requestScope.document.introduction}">
<p><c:out value="${requestScope.document.introduction}"/></p>
</c:if>
<c:if test="${not empty requestScope.document.introduction}">
<p><c:out value="${requestScope.document.introduction}"/></p>
</c:if>
<c:if test="${hst:isReadable(requestScope.document, 'image.original')}">
<hst:link var="img" hippobean="${requestScope.document.image.original}"/>
<figure>
<img src="${img}" title="${fn:escapeXml(requestScope.document.image.fileName)}"
alt="${fn:escapeXml(requestScope.document.image.fileName)}"/>
<figcaption><c:out value="${requestScope.document.image.description}"/></figcaption>
</figure>
</c:if>
<c:if test="${hst:isReadable(requestScope.document, 'image.original')}">
<hst:link var="img" hippobean="${requestScope.document.image.original}"/>
<figure>
<img src="${img}" title="${fn:escapeXml(requestScope.document.image.fileName)}"
alt="${fn:escapeXml(requestScope.document.image.fileName)}"/>
<figcaption><c:out value="${requestScope.document.image.description}"/></figcaption>
</figure>
</c:if>
<hst:html hippohtml="${requestScope.document.content}"/>
<hst:html hippohtml="${requestScope.document.content}"/>
</article>
\ No newline at end of file
</article>
</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