This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

chris.hotz.behofsits3130
chris.hotz.behofsits3130

I have a twig template with the {% page %} section. Is it somehow possible to create a theme, that inherits all html tags, and extends the part between the page section?

Example

<!-- parent.htm -->
<html>
<head></head>
<body>{% page %}</body>
</html>
<!-- child.htm -->
extend parent.htm
<div id="content">{% page %}</div>

the result should be the same as:

<!-- template.htm -->
<html>
<head></head>
<body><div id="content">{% page %}</div></body>
</html>

Last updated

daftspunky
daftspunky

Try this

<!-- parent.htm -->
<html>
<head></head>
<body>{% placeholder parent %}</body>
</html>

<!-- child.htm -->
{% put parent %}
<div id="content">{% page %}</div>
{% endput %}

More information on placeholders can be found in the docs.

Last updated

chris.hotz.behofsits3130
chris.hotz.behofsits3130

I tried it but if I select child.htm as template the cms generates a empty page.

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.