CMS: Displaying Your Blog Posts in a Custom Feed Using a Repeater or Table
4 min read
With the Wix Blog, you get a ready-made blog feed generated for you. But, if you require a little more freedom to customize your feed, such as choosing which elements to show in preview and setting posts to show in chronological order, you can do so using a table or a repeater.
Limitations of custom feeds created with repeaters or tables:
When using this method, site visitors cannot comment on or add likes to blog posts displayed in a custom feed using a repeater or table.
Before you begin:
To use this method, make sure that you've added the following to your site:
- The Wix Blog. Learn more
- Wix App Collections enabled. Learn more
- A few posts and categories. Learn more
- A dataset. Learn more
- The ability to connect content to a repeater or table.
- A page to display your blog posts feed.
Step 1 | Add a repeater or table to the relevant page on your site
A repeater displays your collection using a layout that you can change. For example, you can add another text box, image, or button. A table also displays your collection, but it uses layouts that you cannot change.
To add a repeater or table to the relevant page on your site:
- In the Editor, open the page where you want to display your blog feed.
- Click Add on the left side of the Editor.
- Click List.
- Drag and drop your selected repeater or table onto the page.
Step 2 | Add a dataset to the page (and connect it to the blog post collection)
Repeaters and tables can show items from collections when they are linked via a dataset.
In this step, we add a dataset to associate the repeater or table with the correct collection.
To add a dataset to the page (and connect it to the blog post collection):
- Click CMS on the left side of the Editor.
- Click Add Content Elements then click the Add icon next to Dataset.
- Click the newly added dataset.
- Click Settings.
- Select Posts from the Connect a collection drop-down.
Step 3 | Connect the table or repeater to the dataset
Connect your repeater or table to the blog posts collection.
To connect the table or repeater to the dataset:
- Click your repeater or table in your Editor.
- Click the Connect to Data icon .
- From the Connect a dataset drop-down, select the Posts dataset.
- Link each of the components of your repeater or table to the appropriate fields in the collection. Click the arrow next to each of the components in the repeater or table (text, image etc.) and connect each one to the desired fields in the collection. Note: You can also link an image or button to Post Page URL (URL). This brings the visitor to that blog post when clicked.
- Click Preview.
What’s Next?
- You can control the number of posts being shown using the repeater’s Dataset Settings or the Table Layout.
- Add a pagination or a load more button to display more blog posts.
- Adjust the order of your post to show a specific sequence.
- Create a custom feed displaying blog posts from specific categories. Learn More
Did this help?
|