I want to do something like this:
{% set c=a+b %}
Where a and b are strings.
How can I do it?
You can use:
{{ "Hello " ~ name ~ "!" }}
Use the "~" operator. This will concatenate your two strings. The "+" operator cannot be used to combine strings.
You would get this:
{% set c=a~b %}
More info: The "+" operator: Adds two objects together (the operands are casted to numbers).
The way to do it is:
{% set c = a ~ b %}
A clearer example for the {% block page %}...{% endblock %}:
{% block page %}
{% set page = page | merge({
"title" : branchName,
"description" : "This description has "~branchName~" as its title"
}) %}
{{ parent() }}
{% endblock %}
A clearer example for the {% block content %}...{% endblock %}:
{% block content %}
This is just a sample string for {{ branchName }} that needs no concatenation
{% endblock %}