Customising news output¶
By default, a News & Blog page will simply list items, using the
while an article will use the
At its most basic, all the
article_list.html template does is extend a base template and add
the article list. Similarly, the
article_detail will extend a base template.
It’s easy to override these templates to add your own components to your News & Blog pages. If you add static placeholders to the templates, then you will be able to add arbitrary plugins to it; these will then appear on all the News & Blog pages that use those templates.
Customising a news section page¶
The simplest news section page (the django CMS page that has a News & Blog apphook attached to it) is a list of articles.
The optional Aldryn Bootstrap Boilerplate templates, which will be used if you are using the Aldryn Boilerplate Bootstrap 3 components - see Aldryn Boilerplate support - offer something more sophisticated.
It makes possible the layout represented here, which was taken from the Divio website. It’s worth describing how it’s implemented, to show some of the possibilities.
The page has a static_placeholder
newsblog_feature. Into this are placed:
- a heading, Featured articles
- a Featured articles plugin, set to display the latest three articles on which the “featured” flag has been set
- a heading, Recent articles
newsblog_feature static placeholder, the
simply lists the articles (4).
On the right are the items from the
newsblog_sidebar. These are:
- a Categories plugin, that lists the different categories of article that have been published
- an Authors plugin, that lists different authors of published articles
See Using plugins for more details of the different plugins available.
Customising News & Blog article templates¶
Articles can be similarly customised. For example you might add a Related articles plugin to the static placeholder of your articles, so that each article will display a list of related articles.