How to show a list from a dataset on your website
Testimonials, team members, menu items, frequently asked questions: many parts of a website are really a list. Instead of copying a card by hand for every entry, you can keep the entries in a dataset and let your page show one card per record. In Aglyn you create the dataset in Data, design one card in the editor, and set the row that holds it to repeat. Add a record later, and your published page shows a new card without you touching the page.
Before you start
- Design one card first. Put a single card on your page with the text laid out the way you want each entry to look, for example a quote, a name and a company.
- Decide on your fields. Each piece of text that changes from card to card becomes a field in the dataset.
- Have your first entries ready. A few real records make it easy to check the design.
Step 1: Create a dataset
Open your site in the console and choose Data in the site menu. Choose Add dataset, type a Name such as Testimonials, and type its Fields separated by commas, for example Quote, Name, Company. The dialog previews the columns as you type. Choose Create.
A dataset belongs to your workspace, so every site in it can use the same list.
Step 2: Add your records
Choose Add record. The dialog has one box for each field, so fill in one entry: the quote, the person's name and their company. Choose Add, then add the rest the same way. Each record appears as a row in the table, with View, Edit and Delete beside it.
Step 3: Repeat the row for each record
Open the page in the editor and scroll to your card. Select the card, then select the row that holds it: in the Hierarchy panel it is the item one level up from the card.
With the row selected, open the Attributes tab and find Repeat over dataset. Pick your dataset. Leave Repeat on its starting choice, What is inside this element, so the row stays in place and the card inside it repeats.
The canvas now draws one card for each record, and a badge on the row names the dataset and how many records it found. At this point every card still shows the text you typed.
Step 4: Fill each card from the fields
Select the quote in the first card. In its Text field, clear the typed text first, then choose Insert data, the button beside the field. Search for the field by name, and pick Quote under Dataset item. The Text field now shows a small label named Quote, and each card shows its own record's quote.
Do the same for the name and the company. You only ever edit the first card; the others follow it, so a change of color or font applies to every card.
When every card reads correctly, open the save menu and choose Save & publish.
Step 5: Add a record, get a card
Later, when a new testimonial comes in, go back to Data, choose Add record, fill it in and choose Add. Open your site, and the page shows the new card at the end of the list. You do not open the page in the editor or publish it again.
Common questions
What happens if the dataset is empty?
The badge on the row warns you, and the published page shows no cards rather than an empty card. The editor still shows your design so you can keep working on it.
Can I rename the dataset later?
Yes. The page remembers which dataset it repeats over, so a new name does not break it.
Can I change or remove a record?
Yes. Use Edit or Delete in the records table, and the card on your page changes with it.
Do I need to write any code?
No. You pick each field by name with Insert data, and the editor shows it as a labeled field in the text.
Next steps
- Read the Repeat over data guide for the other repeat settings, such as limiting and ordering the records, and the datasets overview for everything a dataset can hold.
- See what else Aglyn datasets can do, or how Aglyn works for a small business.
- New to the editor? Start with How to edit and add text on your website and How to publish your first page on your website. Selling things instead? See How to add a product to your website, and bring help in with How to invite a teammate to your website.
Share this article
We're building the open web platform. Follow along as we ship — and tell us what you need.