dev-bugfix/xlf-files
dev-bugfix/xlf-files
The Requires
dev-bugfix/IBR-59_list-view-items
dev-bugfix/IBR-59_list-view-items
The Requires
The purpose of this Neos package is to help you create lists of cards similar to the ones at DP Architekten. The package contains two types of lists: the basic card list, and the filterable card list., (*1)
Onedrop.CardLists:List
and Onedrop.CardLists:Card
.Onedrop.CardLists:FilterableList
and Onedrop.CardLists:FilterableCard
.For a basic card list, you need one NodeType for the list itself and one for the cards., (*2)
'My.Site:Card':
superTypes:
'Onedrop.CardLists:Card': true
ui:
label: i18n
properties:
text:
type: string
defaultValue: ''
ui:
inlineEditable: true
aloha:
placeholder: 'Text'
'My.Site:List':
superTypes:
'Onedrop.CardLists:List': true
ui:
label: i18n
childNodes:
cards:
type: 'Neos.Neos:ContentCollection'
constraints:
nodeTypes:
'*': false
'My.Site:Card': true
Create a fusion file for the card:, (*3)
prototype(My.Site:Card) < prototype(Neos.Neos:Content) { sectionName = 'Main' image = Neos.NodeTypes:Image { @context.node = ${node} maximumWidth = 512 maximumHeight = 512 } id = ${node.identifier} }
Create a fusion file for the list:, (*4)
prototype(Onedrop.IbReitberger:TeamMemberList) < prototype(Onedrop.CardLists:List) { listTitle = ${Translation.translate('listTitle', null, [], 'Templates/List', 'My.Site')} }
<f:section name="Main">
<div class="card--wrapper">
<div class="card">
<div class="card--header row">
<div class="card--image col-sm-6">
{image -> f:format.raw()}
</div>
<div class="sliding-card--header-text col-sm-6">
<neos:contentElement.editable property="name" tag="h3"/>
<neos:contentElement.editable property="text" tag="p" />
</div>
</div>
</div>
</div>
</f:section>
Create a fluid template for the list:, (*5)
<f:section name="Main"> <div class="card-list"> <div class="title-bar"> <div class="container"> <div class="title-bar--container"> <div class="title-bar--left"> <h1>{listTitle -> f:format.raw()}</h1> </div> </div> </div> </div> <div id="grid-view" class="grid container"> {cards -> f:format.raw()} </div> </div> </f:section> </html>
The package contains an example implementation of the basic card list (Onedrop.CardLists:ExampleList
)., (*6)
The filterable card list is an extension of the basic card list, and differs from it in the following ways: 1. The title bar contains dropdowns which are used to filter the cards by properties 2. The title bar contains two buttons for switching between the grid view and the list view (while the basic card list has only the grid view) 3. Each card can be assigned a category, by which it can be filtered 4. Each card can be assigned a group, which is used for grouping elements in the list view, (*7)
The steps for creating a filterable card list are similar to the ones for creating a basic card list, with the following adjustments:, (*8)
Onedrop.CardLists:FilterableCard
, not from Onedrop.CardLists:Card
.Onedrop.CardLists:FilterableList
, not from Onedrop.CardLists:List
.id = ${node.identifier}
.Neos.Fusion:RawCollection
called json:
json = Neos.Fusion:RawCollection {
collection = ${q(node).children('cards').children('[instanceof Onedrop.CardLists:Card]')}
itemName = 'listItem'
itemRenderer = Neos.Fusion:RawArray {
name = ${q(listItem).property('name')}
id = ${listItem.identifier}
group = ${q(q(listItem).property('group')).property('name')}
category = ${q(q(listItem).property('category')).property('name')}
property = ${q(listItem).property('property')}
link = Neos.Neos:NodeUri {
node = ${listItem}
}
}
@process.json = ${Json.stringify(value)}
}
For each item in the collection, the JSON object passes the name, the id, the group, the category, and any other properties which should be filterable.grid-{id -> f:format.raw()}
.list-property-
, e.g. list-property-name
. Make sure that the suffix of each id is identical to the name of the corresponding property defined in the fusion or yaml.<div class="title-bar--right">
<div class="filter-list" id="filter-list">
<div class="filter-list--select filter-icon-angle-down">
<select id="filter-select-category">
<option>Category</option>
<option class="d-none">Remove filter</option>
</select>
</div>
<div class="filter-list--select filter-icon-angle-down">
<select id="filter-select-property">
<option>Property</option>
<option class="d-none">Remove filter</option>
</select>
</div>
</div>
<div class="btn grid-btn active" id="grid-btn"><i class="filter-icon-grid"></i></div>
<div class="btn list-btn" id="list-btn"><i class="filter-icon-list"></i></div>
</div>
filter-select-
, and that the suffixes are identical to the names of the properties by which the cards should be filtered. d-none
for the filter to work properly. All other select options will be added dynamically.<f:if condition="{neos:rendering.inBackend()} && {neos:rendering.inEditMode()}">
<div class="filter-config alert alert-info">
<h2>Categories (only visible in backend):</h2>
<div class="filter-config--list">
{categories -> f:format.raw()}
</div>
<h2>Groups (only visible in backend:</h2>
<div class="filter-config--list">
{groups -> f:format.raw()}
</div>
</div>
</f:if>
The package contains an example implementation of the filterable card list (Onedrop.CardLists:ExampleFilterableList
)., (*9)
It is possible to list pages using the Onedrop.CardLists Plugin. You can build a page list like this:
* Create a List NodeType and a Card NodeType as described above, but set the supertype of the List to Onedrop.CardLists:PageList
or Onedrop.CardLists:FilterablePageList
.
* Create a page NodeType which inherits from Onedrop.CardLists:Page
or Onedrop.CardLists:FilterablePage
.
* In the fusion for the List, set the template path to resource://Onedrop.CardLists/Private/Templates/NodeTypes/PageList.html
or resource://Onedrop.CardLists/Private/Templates/NodeTypes/FilterablePageList.html
, or, if you want to create your own template, set the partial path to resource://Onedrop.CardLists/Private/Templates/NodeTypes/Partials
, so that you can use our extension of the Flowpack.Listable:Listable template in your template.
* In the fusion file for the list, let NEOS know that the list elements should be cards. You do this by adding a block of code to the bottom of the file which looks something like this:
prototype(My.Site:ListablePageShort) < prototype(My.Site:Card) {
link = Neos.Neos:NodeUri {
node = ${node}
}
}
, (*10)
This package also contains JS and CSS for the dropdown-cards used on the DP Architekten website. To use these, adjust your card template in the following way:, (*11)
card
classes with sliding-card
.<f:if condition="{neos:rendering.inBackend()}">
<f:then>
<!-- your body -->
<div class="sliding-card--dropdown-btn">
<i class="filter-icon-angle-up"></i>
</div>
</f:then>
<f:else>
<!-- your body -->
<div class="sliding-card--dropdown-btn">
<i class="filter-icon-angle-down"></i>
</div>
</f:else>
</f:if>