Includes

Includes are a convenient way for reusing content portions across multiple places of your publication. They are optimal for storing large and confusing table definitions outside of your main content while making them easily editable. They are also great for storing text that will be used at multiple places within your content, such as license texts, copyright notices, system requirements, call-to-action buttons, etc.

In fact, this demo site uses an Include to for the "Buy now!" button code so it can be easily dropped in anywhere.

Prepage an Include

Before you can add an Include to your content you need to create it. From your site Dashboards Pages section, choose Includes. This is the central place all your includes will be stored at conviniently.

pages-section

From the Add your Includes section, choose Add to create a new Include. Add an Include indicator and your Include text. You may use any Markdown or Markdown Extra features of your liking. Everything that's available to regular pages is available here, too.

One thing to note: after defining new Includes make sure to scroll down all the way to the bottom of the page and hit that big Save button. Otherwise you newly added Includes may be lost.

Using an Include

Importing an include is really easy using the include Kirbytext tag:

( include: copyright)

 ↑ Make sure to remove this space character when copy & pasting…

One thing to keep in mind is that

Recursive Includes

Please note that recursive includes and sub-includes are not supported right now. In easy words that means your includes can't contain other includes.