Skip to content
Johan Janssens edited this page Mar 26, 2019 · 17 revisions

Page decoration allows you to add modules and other elements around your active component's output. The Joomla rendering cycle is intercepted after the active component has been dispatched. Whatever is returned by the component is then injected in a page to be decorated.

Setup

To decorate an existing menu item or page, create a page with the same name as the menu item alias or the page route.

Example: http://mysite.com/path/to/menu => /joomlatools-pages/pages/path/to/menu

In the page, place a <ktml:content> which will act as the placeholder for output generated by the component. The output is decorated and injected back into Joomla after processing.

// Some decoration

<ktml:content> /* This holds the output generated by the component */

// More decoration

Decorating applies to both menu items and pages generated by a component. For example: http://mysite/[articles]/[uncategorised/myarticle]

  • articles is a menu item that links to the Joomla content component using an 'List All Categories' menu type.

  • uncategorised/myarticle is a page generated by the content component. It shows the article with alias myarticle that is part of the uncategorised category.

Frontmatter

You can specify how deep the decoration takes effect using the decorate process modifier. The possible values are:

  • 0: only decorate the specific page
  • n: decorate as deep as n
  • true: decorate all (default)
  • false: do not decorate
---
process: 
    decorate: true
---

You can also use the frontmatter to overwrite the Joomla menu item settings. Settings defined in the frontmatter will override the Joomla menu item settings.

Example:

---
title: Title override
summary: Description override
---

Clone this wiki locally