Brief documentation

This commit is contained in:
Fabian Braun 2016-07-06 16:14:22 +02:00
parent dad1569aea
commit af2defc46a
2 changed files with 22 additions and 0 deletions

View file

@ -149,6 +149,25 @@ To use this feature provide a directory name in **Template prefix** field in
the **Apphook configuration** admin (in *Layout* section): it will be the the **Apphook configuration** admin (in *Layout* section): it will be the
root of your custom templates set. root of your custom templates set.
****************
Plugin Templates
****************
Plugin templates live in the ``plugins`` folder of the folder specified by the **Template prefix**, or by default ``djangocms_blog``.
By defining the setting ``BLOG_PLUGIN_TEMPLATE_FOLDERS`` you can allow multiple sets of plugin templates allowing for different views per plugin instance. You could, for example, have a plugin displaying latest posts as a list, a table or in masonry style.
To use this feature define ``BLOG_PLUGIN_TEMPLATE_FOLDERS`` as a list of available templates. Each item of this list itself is a list of the form ``('[folder_name]', '[verbose name]')``. Example:
BLOG_PLUGIN_TEMPLATE_FOLDERS = (
('plugins', _('Default template') ), # reads from "templates/djangocms_blog/plugins/
('timeline', _('Vertical timeline') ), # reads from "templates/djangocms_blog/vertical/
('masonry', _('Masonry style') ), # reads from "templates/djangocms_blog/masonry/
)
Once defined, the plugin admin interface will allow content managers to select which template the plugin will use.
.. _sitemap: .. _sitemap:
******* *******

View file

@ -91,6 +91,9 @@ Global Settings
* BLOG_FEED_INSTANT_ITEMS: Number of items in Instant Article feed * BLOG_FEED_INSTANT_ITEMS: Number of items in Instant Article feed
* BLOG_FEED_LATEST_ITEMS: Number of items in latest items feed * BLOG_FEED_LATEST_ITEMS: Number of items in latest items feed
* BLOG_FEED_TAGS_ITEMS: Number of items in per tags feed * BLOG_FEED_TAGS_ITEMS: Number of items in per tags feed
* BLOG_PLUGIN_TEMPLATE_FOLDERS: (Sub-)folder from which the plugin templates are loaded.
The default folder is `plugins`. It goes into the `djangocms_blog` template folder (or, if set, the folder named in the app hook). This allows, e.g., different templates for showing a post list as tables, columns, ... . New templates have the same names as the standard templates in the `plugins` folder (`latest_entries.html`, `authors.html`, `tags.html`, `categories.html`, `archive.html`). Default behavior corresponds to this setting being `( ("plugins", _("Default template") )`. To add new templates add to this setting, e.g., `('timeline', _('Vertical timeline') )`.
****************** ******************
Read-only settings Read-only settings