Multiple news/weblog sections¶
Your project can host multiple independent news/weblog sections, each with their own items. For example, a company website might have a news section for publishing press releases, and a weblog for publishing more informal articles.
To do this, you need to create a django CMS page for each news/weblog section, and add an apphook for Aldryn News & Blog to each of them. You will also need to create a separate apphook configuration for each of them - apphook configurations cannot be shared between apphook instances.
Creating a new News & Blog section¶
The quickest way to do this is:
- Create the new page.
- In its Advanced settings, choose Newsblog in the Application field. A new field, Application configurations, will appear immediately below it.
- Add a new application configuration, by selecting the + icon.
Fields¶
Instance namespace - a unique (and slug-like) name for this configuration. Note that this cannot be subsequently changed.
Application title - A human-readable name for the configuration, that helps explain its purpose to the users of the system. For example, if this news section will publish press releases, call it Press releases. The name will be reflected in the django CMS toolbar when you’re on that page.
Permalink type - the format of canonical URLs for articles in this section.
Non-permalink-handling - For convenience, the system can optionally resolve URLs that are not in
the canonical format. For example, if the canonical URL is 2016/11/27/man-bites-dog
, the URL
man-bites-dog
can redirect to it. This behaviour is the default, but optional.
Prefix for template directories - If you’d like this news section to use custom templates, create
a set in a new directory. So for example, instead of using the default
aldryn_newsblog/article_list.html
, it will look for
aldryn_newsblog/custom-directory/article_list.html
.
Include in search index - see Per-apphook indexing.
Other fields are self-explanatory.
Apphook configurations can also be created and edited in other ways:
- from the Django Admin, in Aldryn News & Blog > Application configuration
- from the option Configure addon... in the apphook’s menu in the django CMS toolbar
Access to application configuration¶
Typically, you will not provide most content editors of your site with admin permissions to manage apphooks - this should be reserved for site managers.