AttRibutes
CMS Previous Next
What is this page about?

Attributes, by Finsweet, offers a free series of Solutions that provide essential features to improve your Webflow websites.

List Previous Next

Create previous and next items on Webflow CMS Templates.

List Previous Next • Flash Card

Copy Script

For advanced users familiar with this solution. Includes all attributes from this page. Click on attributes and values to copy them.

Required attributes

List

Add to Collection List or Collection List Wrapper

fs-list-element
=
"
list
"

Previous

Add to Div Block

fs-list-element
=
"
previous-item
"

Next

Add to Div Block

fs-list-element
=
"
next-item
"

Previous Empty

To Div Block, Text Element, Button, Link Block, Text Link

fs-list-element
=
"
previous-empty
"

Next-empty

To Div Block, Text Element, Button, Link Block, Text Link

fs-list-element
=
"
next-empty
"
1

Add this <script> inside the <head> tag of your page or project

This script is the universal Attribute script: you only need to include it once, even if you have multiple Attribute solutions on the page. Learn more .

<script async type="module"
src="https://cdn.jsdelivr.net/npm/@finsweet/attributes@2/attributes.js"
fs-list
></script>

Copy Script
2

Add these required attributes to the elements

List

A Collection List with all items, used as the reference
fs-list-element
=
"
list
"

For this Solution to work, it must reference a Collection List in the current page, that displays all Collection Items.

This attribute is added to this Collection List. The List is used to create the "Previous" and "Next" content — the content for each Collection Item of the List will populate the Previous and Next blocks.

The list will position the Previous item in the previous element and the Next item in the next element, exactly as they're designed and styled in the Collection List.

Add this attribute:
Name
fs-list-element
Copy
Value
list
Copy
Add it to those type(s) of element(s):
Collection List
IMPORTANT

Each item must have a URL link to its Template Page — the Current link.

Using the URL link to the Template Page, Attributes will search in this Collection List for the current item, identifying the CMS Template Page the user is viewing. From the current item, Attributes will determine the Previous and Next item.

NOTE

This List can be invisible on the page using display: none, it's only used for generating content for the Previous and Next posts.

NOTE

Attributes will respect the sorting of the List.

Previous

The Div where the "Previous" item will be moved
fs-list-element
=
"
previous-item
"

This Div Block serves as the parent container for the "Previous" CMS Item in the list. The content of the "Previous" item will be shown inside of it.

Add this attribute:
Name
fs-list-element
Copy
Value
previous-item
Copy
Add it to those type(s) of element(s):
Div Block

Next

The Div where the "Next" item will be moved
fs-list-element
=
"
next-item
"

This Div Block serves as the parent container for the "Next" CMS Item in the list. The content of the "Next" item will be shown inside of it.

Add this attribute:
Name
fs-list-element
Copy
Value
next-item
Copy
Add it to those type(s) of element(s):
Div Block
3

Check that the Collection Item contains a link to the Current page

Link in the List

Each item must have a URL Link to its CMS Collection Page (item) page.

Using the URL link to the Template page, Attributes will search in this Collection List for the current item, identifying the CMS Template page the user is viewing. From the current Item, Attributes will determine the Previous and Next item.

4

Publish your project! Done, easy right?

Check more elements and settings below
Optional

Add more

elements

Previous Empty

A component shown when there's no "Previous" item to link to
fs-list-element
=
"
previous-empty
"

An optional element that displays a custom 'empty' message if there is no "Previous" item.

Without this setting, no message will appear when a "Previous" item is absent.

Add this attribute:
Name
fs-list-element
Copy
Value
previous-empty
Copy
Add it to those type(s) of element(s):
Div Block
Text Block
Button
Link Block
Link

Next Empty

A component shown when there's no "Next" item to link to
fs-list-element
=
"
next-empty
"

An optional element that displays a custom 'empty' message if there is no "Next" item.

Without this setting, no message will appear when a "Next" item is absent.

Add this attribute:
Name
fs-list-element
Copy
Value
next-empty
Copy
Add it to those type(s) of element(s):
Div Block
Text Block
Button
Link Block
Link

Still need help?