# Create a new layout
In order to create a new layout, create a new jsp
file in the site repository:
www.example.com/themes/default/layouts/newCustomLayout.jsp
Declare this layout in the Layout Descriptor as the name
value:
{
"name": "/newCustomLayout",
"key": "customLayoutKey"
}
In the layout, consume the item(s) selected by the whiteCollar. You can write the whole layout from scratch, consuming each or reuse existing layouts from Marfeel's defaults:
Consuming an existing layout:
<c:set var="customItems" value="${content.getItems()}" scope="page"/>
<div>
<c:if test="${not empty customItems}">
<c:set var="item" value="${customItems[0]}" scope="page"/>
<dali:importLayout url="layouts/newspaper/pill.jsp" item="${item}" position="1" itemCanOverrideLayout="true"/>
</c:if>
</div>
Writing the whole layout from scratch:
<c:set var="customItems" value="${content.getItems()}" scope="page"/>
<div id="mrf-customLayoutContainer">
<a class="mrf-customLayout--link" href="${customItems.get(0).pocket.link}">
<h2 class="mrf-customLayout--header" class="mrf-archivo-link">Custom Layout</h2>
</a>
</div>
TIP
Remember to import at the beginning of the file all the taglib
needed, such as core
, dali
, or any other you use.
<%@taglib prefix="dali" uri="http://dev.marfeel.com/jsp/mrf/dali" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>