Articles are loaded via the agency admin link:
/configure/website/content/articles. They can then be queried anywhere on a theme using the agency articles loop. Here’s an example construct:
The articles index is a static file that needs to reside in an
articles folder in your theme. This index can be accessed using the URL
The article show page is simply a
show.liquid file in your articles directory that has access to the article object:
Topics are a useful way of grouping articles. You can loop through and query articles and topics in the same way we’ve seen in the other articles write-ups:
This next assign statement gets all articles of a certain topic, or in the example shown it actually returns articles for either ‘Press Release’ or ‘News’ topics using comma separated values.
Note: These are case sensitive and also require no spaces between the words.
You can then loop through the array as you would normally do. Each result is an article object with all its attrbutes:
In order to enable infinite scroll for articles you need to specify the initial containing element that is to be appended with the infinite scroll template.
Below is an example of defining the infinite scroll template which is used to render the subsequent blocks of article results at the end of the infinite_pages element.
You also need to enable infinite scroll like so:
Auto scrolling can be turned on or off with the following:
The Ctesius event
'article_infinite_scroll_performed' is triggered when the page has been successfully loaded.
If you are planning on using infinite scroll on pages where you have articles for a specific topic you will need to call the following variation on button click to pass in the selected topic:
The articles infinite scroll uses a liquid JSON (LJSON) partial named
_articles_list.ljson an example of this file can be found in the stabilisers theme here.
If you want to override this file for any variations or if you need any missing article methods then you can make your own file in the articles folder in your theme.