Skip to content

Content editing

Thorsten Marx ㋡ edited this page Dec 26, 2023 · 13 revisions

Content file format

Content Files contains to areas. The header or metadata and the content area.

Example content file

---
title: Startpage
description: "header is in yaml"
template: start.html
---

Here comes the content of your page, formatted with markdown

Header

Menu options

If you use the navigationFunction to build the menu of your site, there are some options to influence the menu entry for a node.

menu:
    title: The Blog
    position: 100
    visible: false

Sections

Whenever you need to provide more complex content on a page, sections come in handy. Sections are just like simple content pages, but are not found via the nodeListFunction or navigationFunction, but are assigned to a page. You can have multiple content files for the same section. Each section can have its own rendering template.

Naming convention

Assume you content page is names: index.md

Your sections must be named as follows: index.<section_name>.md
for example: index.content.md

If your sections must be in a specific order, use this naming: index.<section_name>..md
for example: index.content.1.md and index.content.2.md

Accessing sections in template code

<div class="container" th:if="${sections.containsKey('part')}">
	<th:block th:each="part : ${sections.get('part')}">
		<th:block th:utext="${part.content}"></th:block>
	</th:block>
</div>

ShortCodes

With version 2.6.0 we introduce shortcodes to extend content rendering with custom functionality without extending the markdown renderer itself. How to define custom shortcode is described in the documentation for extension under shortcodes.

Here is the example usage of the simple youtube shortcode, described in the extensions documentation.

[[youtube video='C0DPdy98e4c'/]]

Shortcodes are rendered before the markdown rendering takes place. So Theoretical, it is possible for a shortcode implementation to return valid markdown code. But in practice shortcodes are used to add functionality, which is not covered by markdown. So you would return some html.

The cms does not provide any shortcode, but this can change in future.

Clone this wiki locally