Article templates
Intro
You can define one or more article templates that the editors use to publish contents. The article templates are configured by default in app/config/cms/templates.yml
wf_cms_base_admin:
article_templates:
default: ~
opinion:
category_bound: opinion
mam:
category_bound:
- live
- mam
special_article:
category_bound:
main: video
secondary:
- deportes
- politica
static:
type: static
There are various types of article templates (in the example above):
generic
: the default type of articles, used if you don't specify anythingcategory_bound
: the editor can choose only a subcategory of the category with slug specified ascategory_bound
option. If that category has no subcategories, the category dropdown won't be displayed at all - it's being replaced with a hidden input.The value for the
category_bound
can be:- a string: the category slug to which the bind the template - this will allow selecting children of the given category
- an array of strings: the category slugs to which to bind the template - this will allow selecting children of any of the given categories
- an array with
main
(required) andsecondary
(optional) keys. Both these keys can have either a string value or an array of strings value. This allows binding the template to the category or categories specified inmain
, but also adds thesecondaryCategories
field and binds them to the category or categories specified in thesecondary
key
static
: a special type ofcategory_bound
article, bound to categorypages
. MAKE SURE you have a category with slugpages
when enabling this option. Besides being bound to this category, the articles also have some options on whether to display or not the title and the sidebar.
The templates will be looked for in App/Bundle/CmsBundle/Resources/views/Templates/Article/__TEMPLATE_ID__.html.twig
.
One important requirement is that the article templates must have a title
module:
<h1 wf-role="title"></h1>
Find out the form type used for an article
In Symfony's debug toolbar there's an icon for the forms panel:
Clicking on it reveals the form type class used on that page:
Note: The class listed there is a class that Symfony creates automatically and stores in the cache folder, but its name is the same as the one in XalokNext, having a _UNIQUE_HASH
suffix.