How to insert one page into another?

Hi

I just begin with Grav. I nee to make a template to use with 2/3 site width is content edited with Markdown and 1/3 site width is for static links. How t achieve this result?

I tried to use this topic: https://learn.getgrav.org/16/cookbook/general-recipes#reuse-page-or-modular-content-on-another-page but still not working.

{% extends 'partials/base.html.twig' %}

{% set blog_image = page.media.images[page.header.hero_image] ?: page.media.images|first %}

{% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog])|defined(true) %}

{% set show_sidebar = header_var('show_sidebar', [page, blog])|defined(true)  %}

{% set show_pagination = header_var('show_pagination', [page, blog])|defined(true) %}

{% block hero %}

    {% include 'partials/hero.html.twig' %}

{% endblock %}

{% block body %}

    <section id="body-wrapper">

        <section class="container {{ grid_size }}">

        {% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %}

            {% include 'partials/breadcrumbs.html.twig' %}

        {% endif %}

        {% embed 'partials/layout.html.twig' %}

            {% block content %}

                {% include "partials/content.html.twig" %}

            {% endblock %}

            {% block sidebar %}

                {% include 'partials/sidebar.html.twig' %}

            {% endblock %}

        {% endembed %}

        </section>

    </section>

    <script>

        //Bricklayer

        var bricklayer = new Bricklayer(document.querySelector('.bricklayer'))

    </script>

{% endblock %}

Easy way is to just create your new page for the sidebar and then use a page.find on the pages you want to include the sidebar on.

{{ page.find(’/sidebar’).content }}

I actually use a table to layout my pages and then make the table responsive. This makes laying out content fast and the code is clean.

I just put up a sample to see how the sidebar works at toms-sandbox.com/grav/

Forgot to mention, make sure your page is set to process twig in the Advanced Tab.

I would like to note, that creating a layout inside the Markdown of a page is not considered a good practice. The structure and layout of a page should be taken care of in the template and css.

Also the use of <table> for creating a layout should be avoided.

See my more elaborate comment on another post.

A bit off-topic, but you might want to try CSS grid and/or flex - you’d have much more control

@Karmalakas,

I agree but you really can’t work easily with those in the editor. The table was a test to see if you could design visually from the editor. It would be more for those who can’t or don’t want to code. As I explained in another post in the forum, there are many people ( including clients ) who don’t want to learn to code to make layout and design changes to a website. How do you develop a site to turn over to a client knowing that every change outside of text and images they will need to hire you or someone else to make? This is a step backwards from where most other standard platforms offer.

People want sites that work and are easy to develop and work with. This is the reason why Wix, Weebly and Squarespace market shares keep climbing and why Wordpress has now added Gutenberg into their platform and has plans for making it a complete template/theme/content system. The average person does not want to have to write lines of code every time they want to make changes to their websites.

My motto is to do what works and makes a client happy. Find solutions not complicate the lives of the people paying the bills.

I am still only a few days into using Grav. I have a lot to learn and I appreciate the input from you and other members. I am still trying to see what works and what doesn’t. Right now, it feels like I am re-inventing the wheel for every little thing. Maybe it is because I am fighting against working in a way that Grav had intended to be used, but I am a glutton for punishment ( haha ) and like to learn and try different things outside the normal.