Feature: Inheritance
As a designer
I want to be able to build more complex page html layouts
with shared template code
that render correctly to the client
Background:
Given I have the site: "test site" set up
Scenario: Liquid Inheritance with a single block
Given a page named "above-and-below" with the template:
"""
{% block body %}DEFAULT BODY CONTENT{% endblock %}
"""
And a page named "hello-world-multiblocks" with the template:
"""
{% extends 'layout-with-sidebar' %}
{% block body %}Hello world{% endblock %}
"""
When I view the rendered page at "/hello-world-multiblocks"
Then the rendered output should look like:
"""
{% block body %}DEFAULT BODY CONTENT{% endblock %}
"""
And a page named "custom-layout-with-sidebar" with the template:
"""
{% extends 'layout-with-sidebar' %}
{% block sidebar %}Custom sidebar{% endblock %}
{% block body %}Hello{% endblock %}
"""
And a page named "hello-world-multiblocks" with the template:
"""
{% extends 'custom-layout-with-sidebar' %}
{% block body %}{{ block.super }} world{% endblock %}
"""
When I view the rendered page at "/hello-world-multiblocks"
Then the rendered output should look like:
"""
{% block body %}Hello{% endblock %}
"""
And a page named "custom-layout-with-sidebar" with the template:
"""
{% extends 'layout-with-sidebar' %}
{% block body %}{{ block.super }} {% block main %}mister{% endblock %}{% endblock %}
"""
And a page named "hello-world-multiblocks" with the template:
"""
{% extends 'custom-layout-with-sidebar' %}
{% block main %}{{ block.super }} Jacques{% endblock %}
"""
When I view the rendered page at "/hello-world-multiblocks"
Then the rendered output should look like:
"""