"set" should be declare vars global

33 views
Skip to first unread message

Jochen Pier

unread,
Jul 8, 2016, 12:30:16 PM7/8/16
to Pebble Templating Engine
It would be fine, if child-templates could pass information to the parent via the "set" method.

Example:

parent.pebble:
##################

    <h2>{{ title }}</h2>

{% block content %}{% endblock %}

##################



child.pebble

##################

{% extends "parent" %}

{% block content %}

{% set title = "My Title" %}

{% endblock %}

##################

Jochen Pier

unread,
Jul 11, 2016, 3:11:29 AM7/11/16
to Pebble Templating Engine

I'm sorry - it just works. If you move the "{% set title = "My Title" %}" out of the block - then it works !!

##################
{% extends "parent" %}

{% set title = "My Title" %}

{% block content %}
..
{% endblock %}
##################

Reply all
Reply to author
Forward
0 new messages