Skip to content
Johan Janssens edited this page Mar 10, 2021 · 17 revisions

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

Table of contents

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> tag 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
---

Overrides

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

The following menu item settings can be overridden:

  • Title
  • Description
  • Metadata
  • Direction

Example:

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

Pages offers out-of-the-box support for Opengraph and Opengraph metadata will automatically be added to your page if you are decorating it.

See also: Page

Clone this wiki locally