A list that finds its entries by itself is called Smart Content in Sulu. With the filter icon you set the source, filters, sort order and number. On the example website Smart Content sits in the block Collection. It also offers a selection by hand and its own display.
Series 3: Managing content in detail Chapter 5 of 14
Automatic lists with Smart Content
In short
In Sulu such a list is called Smart Content. You set rules, for example “all articles with the tag Winterreifen”, and Sulu finds the matching entries by itself.
Smart Content is a field in the template of a page. Whether there is one and what it is called is set by your website. On the example website it sits in the block Collection, which the second part shows.
Helpful first: 3.1 Building pages with blocks 3.4 Using categories and tags sensibly
Step 1 of 6 Finding the Smart Content field
The image shows a page whose template has a Smart Content field, in a Sulu without extensions. Here the field is called Pages. Below it you see how many entries the rules currently find, for example 0 elements selected.
Click the filter icon (1). It opens the window with the rules.
Step 2 of 6 Setting the rules
The window carries the name of the field, here Configure Pages. Under Select source you choose where the entries come from, for example a page. With the switch Include sub elements the levels below it are included as well.
Below that you filter by categories, tags and types. Further down are Sort by and Limit result to. With Confirm you apply the rules, then you save the page.
On the example website: the block Collection
The template of the example website brings Smart Content in the block Collection. The block can do more than the field: choose entries by hand, set the display and use profiles. The following steps only apply to websites with this template.
Step 3 of 6 Choosing the content type and kind of selection
Add the block Collection to the page or open an existing one. Under Selection, the Content Type (1) decides what the list shows: Pages, Teasers, Testimonials, Articles or Events. Testimonials and Events only exist with the matching extensions.
Under the kind of selection (2) you have two options. With Manual you choose the entries one by one. With Filtered Sulu selects them by filters. The filter icon (3) opens the window for this.
Step 4 of 6 Setting the filters
The filter icon opens the same window as for the field above, here called Configure Filtered Articles. At Filter by tags (1) you enter the beginning of a tag and choose it from the suggestions.
At Sort by (2) you choose how the list is ordered: Published on, Authored on, Created on, Changed on or Title. Next to it is Ascending or Descending. With Limit result to (3) you limit the number of entries. With Confirm (4) you apply the rules.
Step 5 of 6 Checking the result
Under Filtered Articles you now see how many entries the rules find (1), in the example one article with the tag Winterreifen. The preview on the right shows the list straight away (2). If the number is not right, open the filter icon again and change the rules.
Step 6 of 6 Setting the display
How the list looks is set in the Collection Configuration. At Source, choose Custom display. The Display Style (1) then decides the form: tiles in a grid, a list with preview images or a slider. The Tile size (2) is normal or small. The Badge (3) is the small label on top of the tile. Without your own choice, the display from the profile of the page applies.
Manual or filtered?
The block Collection offers this choice.
- Manual fits when the list should show exactly these entries, for example the five most important services in a fixed order.
- Filtered fits when the list should follow a rule, for example the three newest articles on a topic. You set the rule once and do not need to choose entries one by one.
Create the tags and categories you filter by beforehand and assign them to the entries: Using categories and tags sensibly.
The preview shows every change straight away. The new list only appears on the website once you save and publish the page.
- 7.6Collection profiles: lists and tiles Applies to: Template of the example website