生产时嵌套块不尊重page.twig

问题描述

问题:在生产环境中,Page.twig无法正常显示。 Base.twig呈现。 在开发环境中,所有工作均正常进行。两个站点完全相等(克隆)。唯一的区别是生产可以在Apache上运行,而开发则使用Nginx

Page.twig

{% extends "base.twig" %}

{% block center_section %}
    <section id="content" role="main" class="container">
        <div class="row">
            <div class="col-12 p-0 mb-4">
                {% block content %}
                    <h1 class="h2 font-libre m-0">{{post.title}}</h1>
                    <div class="content-wrapper">
                        <article class="post-type-{{post.post_type}} card content-wrapper border-0 no-border-radius p-3" id="post-{{post.ID}}">
                            <section class="article-content">
                                <div class="article-body">
                                    {{post.content}}
                                </div>
                            </section>
                        </article>
                    </div><!-- /content-wrapper -->
                {% endblock %}
            </div>
        </div>
    </section>
{% endblock %}

Page.PHP

$context = Timber::context();
$timber_post     = new Timber\Post();
$context['post'] = $timber_post;
Timber::render( array( 'page-' . $timber_post->post_name . '.twig','page.twig' ),$context );

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)