Unstack Dev Docs
Search…
Articles
The ArticleCollection generator allows you to create components powered by dynamic blog content. Users can optionally filter, sort, and pin articles to a given section using this component, giving them the flexibility to selectively display editorial content throughout your site.
1
<ArticleCollection
2
dataRef={content.articles} tagName="div"
3
item={{(article)=>
4
<div class="article">
5
<div class="title">
6
<a href={`/${article.slug}`}>{article.content.header}</a>
7
</div>
8
</div>
9
}} .../>
Copied!

Articles Tag Props:

  • dataRef: DataLocator - the data-element storing the ArticleCollection's configuration
  • item: anonymous arrow function - used to render an article
  • tagName: string (optional) - a hard-coded tag name for the rendered element
  • className: string (optional) - a hard-coded class name to add to the rendered element
  • minItems: number (optional) - the minumum # of items allowed in this collection (Default: 1)
  • maxItems: number (optional) - the maximum # of items allowed in this collection (Default: 10)
  • defaultItems: number (optional) - the starting # of items in this collection on creation
  • enablePinning: boolean (optional) - when True, allows content authors to pin specific articles to this list semi-permanently, until unpinned (Default: True)
  • enableFiltering: boolean (optional) - when True, allows content authors to select the blog, category, or tags by which to filter articles for this list (Default: True)
  • enableSorting: boolean (optional) - when True, allows content authors to select the sorting order by which to filter articles for this list (Default: True)
Last modified 4mo ago
Copy link