Skip to content

Commit b35b66a

Browse files
committed
[FIX] New page template creation method
closes #14107 Signed-off-by: Brandon Mercier (bram) <[email protected]>
1 parent 09a33fe commit b35b66a

File tree

1 file changed

+15
-12
lines changed
  • content/developer/howtos/website_themes

1 file changed

+15
-12
lines changed

content/developer/howtos/website_themes/pages.rst

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,11 @@ Create preset static page templates available from the New Page dialog window.
274274
**Declaration**
275275

276276
The page templates has to be defined into the :file:`__manifest__.py` of the module through
277-
`new_page_templates`:
277+
`new_page_templates` and :file:`new_page_template_templates.xml`:
278278

279279
.. code-block:: python
280280
:caption: `/website_airproof/__manifest__.py`
281-
:emphasize-lines: 15-18
281+
:emphasize-lines: 11,16-19
282282
283283
{
284284
'name': 'Airproof Theme',
@@ -290,6 +290,7 @@ The page templates has to be defined into the :file:`__manifest__.py` of the mod
290290
'depends': ['website'],
291291
'data': [
292292
# ...
293+
'views/new_page_template_templates.xml'
293294
],
294295
'assets': {
295296
# ...
@@ -329,20 +330,22 @@ Instantiate each building block (modified or not) for the page template:
329330
<template id="new_page_template_s_airproof_text_block_h1" inherit_id="website_airproof.s_airproof_text_block_h1" primary="True"/>
330331
<template id="new_page_template_airproof_faq_s_title" inherit_id="website.s_title" primary="True"/>
331332
332-
Then, create your page template with some `t-snippet-call` within an '#wrap' as explained above:
333+
Then, create your page template with some `t-snippet-call` within an `#wrap` as explained above:
333334
334335
.. code-block:: xml
335336
:caption: `/website_airproof/views/new_page_template_templates.xml`
336337
337-
<div id="wrap">
338-
<t t-snippet-call="website_airproof.new_page_template_airproof_faq_s_text_block_h1"/>
339-
<t t-snippet-call="website_airproof.new_page_template_airproof_faq_s_title"/>
340-
<t t-snippet-call="website_airproof.new_page_template_airproof_faq_s_faq_collapse"/>
341-
<t t-snippet-call="website_airproof.new_page_template_airproof_faq_s_call_to_action"/>
342-
</div>
338+
<template id="new_page_template_sections_airproof_faq" name="Airproof - New Page Template FAQ">
339+
<div id="wrap">
340+
<t t-snippet-call="website_airproof.new_page_template_airproof_faq_s_text_block_h1"/>
341+
<t t-snippet-call="website_airproof.new_page_template_airproof_faq_s_title"/>
342+
<t t-snippet-call="website_airproof.new_page_template_airproof_faq_s_faq_collapse"/>
343+
<t t-snippet-call="website_airproof.new_page_template_airproof_faq_s_call_to_action"/>
344+
</div>
345+
</template>
343346
344-
Once the page template is created, it can be added to an existing group. Find below a list of the
345-
existing group:
347+
Once the page template is created, create a custom group and add it to the existing ones. Find below a list of the
348+
existing groups:
346349
347350
.. code-block:: xml
348351
:caption: `/website/views/new_page_template_templates.xml`
@@ -362,7 +365,7 @@ Feel free to add custom groups to the list:
362365
.. code-block:: xml
363366
:caption: `/website_airproof/views/new_page_template_templates.xml`
364367
365-
<template id="new_pages_template_groups" inherit_id="website.new_pages_template_groups" name="Airproof - New Page Template Groups">
368+
<template id="new_page_template_groups" inherit_id="website.new_page_template_groups" name="Airproof - New Page Template Groups">
366369
<xpath expr="//div[@id='custom']" position="after">
367370
<div id="airproof">Airproof</div>
368371
</xpath>

0 commit comments

Comments
 (0)