After reading http://docs.sulu.io/en/latest/cookbook/live-preview.html and also crosschecking the example.html.twig I still can not find out why the love preview is not working in my template.
My Template hierarchy (using the theme bundle):
- bs_homepage.html.twig, extends:
- main.html.twig, extends:
- master.html.twig
In a nutshell the structure is like:
bs_homepage.html.twig (just sets some parameters and calls the main template)
{% extends "DWBNFrontendBundle:main:main.html.twig" %}
main.html.twig
{% block content %}
[...]
<div id="content" class="container" vocab="http://schema.org/" typeof="Content">
[...]
<div class="row">
[...]
<section class="col-sm-{{ mainCollSize }} main-content" id="content" vocab="http://schema.org/" typeof="Content">
{% if content.title %}
<h1 property="title">{{ content.title }}</h1>
{% endif %}
[...]
</div>
</div>
{% endblock %}
master.html.twig
[...]
<body>
<!-- content -->
{% block content %}{% endblock %}
<!-- /content -->
[...]
</block>
And the xml definitions:
bs_homepage.xml:
<?xml version="1.0" ?>
<template xmlns="http://schemas.sulu.io/template/template"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xi="http://www.w3.org/2001/XInclude"
xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.1.xsd">
<key>bs_homepage</key>
<view>DWBNFrontendBundle:templates:bs_homepage</view>
<controller>SuluWebsiteBundle:Default:index</controller>
<cacheLifetime>2400</cacheLifetime>
<meta>
<title lang="de">Startseite</title>
<title lang="en">Homepage</title>
</meta>
<properties>
<xi:include href="fragments/content-core.xml" xpointer="xmlns(sulu=http://schemas.sulu.io/template/template) xpointer(/sulu:template/sulu:properties/sulu:section[@name='highlight'])"/>
[...]
</properties>
</template>
fragments/content-core.xml:
<?xml version="1.0" ?>
<template xmlns="http://schemas.sulu.io/template/template"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.1.xsd">
<properties>
<section name="highlight">
<properties>
<property name="title" type="text_line" mandatory="true">
<params>
<param name="headline" value="true"/>
</params>
<tag name="sulu.rlp.part"/>
</property>
[...]
</properties>
</section>
</properties>
</template>
But if I change the title, nothing happens in the preview window.