Forum

Thread tagged as: Problem

Layout templates not updating---caching problem maybe?

Diagnostic Report


Perch: 2.8.29, PHP: 5.6.16, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO Server OS: WINNT, apache2handler Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29), perch_events (1.9.3) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_events', ); PERCH_LOGINPATH: /lakehouse/perch PERCH_PATH: C:\Users\Webmaster.Lobby-PC\Websites\wamp64\www\lakehouse\perch PERCH_CORE: C:\Users\Webmaster.Lobby-PC\Websites\wamp64\www\lakehouse\perch\core PERCH_RESFILEPATH: C:\Users\Webmaster.Lobby-PC\Websites\wamp64\www\lakehouse\perch\resources Image manipulation: GD PHP limits: Max upload 2M, Max POST 8M, Memory: 128M, Total max file upload: 2M F1: 2edba60ed1f613d6dd804feb202456a2 Resource folder writeable: Yes HTTP_HOST: localhost DOCUMENT_ROOT: C:/Users/Webmaster.Lobby-PC/Websites/wamp64/www/ REQUEST_URI: /lakehouse/perch/core/settings/diagnostics/ SCRIPT_NAME: /lakehouse/perch/core/settings/diagnostics/index.php

Problem

Background

In the process of converting a static HTML website to be increasingly content managed, the <header> element was cut out of every page and placed in a universal header layout template, global.header.php. This was included through <?php perch_layout('global.header'); ?>.

This works. The header shows up on every page. What's more, I've just verified that the PHP for the individual pages is still running, because I added HTML comments before and after the PHP inclusion of the header, and in the rendered page those comments appeared before and after the <header> element, as expected. When the line that imports the header is deleted out of the page, the header disappears, as expected.

The <header> element contains the navigation. Currently, I'm trying to implement content-managed navigation using a navigation template main-nav.html, located in /perch/templates/navigation/main-nav.html, with this PHP from within global.header.php:

<?php
        perch_pages_navigation(array(
        'template' => 'main-nav.html',
        'from-path' => 'deploy1/',
        'levels' => 1,
        'hide-extensions' => false,
        'hide-default-doc' => true,
        'flat' => true,
    ));
?>

What's Wrong

The change to global.header.php is not reflected in the rendered page. The old static navigation was still appearing on every page, clearly not being rendered by Perch. New HTML comments within global.header.php did not show up. Finally, all the content of global.header.php was deleted, leaving an empty file, and still all the content from the original header appears on all the pages in the website.

To double-check, the line <?php perch_layout('global.header'); ?> was again deleted from one of the pages, and again the header disappeared. When it is added again, even though the referenced file is empty, the original header returns.

Full Disclosure

The diagnostic report shows "wamp64\www\lakehouse\perch" as the Perch directory, and the file global.header.php is indeed located in "wamp64\www\lakehouse\perch\templates\layouts". However, within the same "wamp64\www\" directory, the actual files for this version of the local website are located in a different subdirectory, not "\lakehouse\". However, this subdirectory also contains the exact same version of global.header.php (and all other files, except for HTML/PHP files for the actual webpages). Whenever I changed the header template or the navigation template in one directory, I changed it in the other as well. I'm not trying to make it more complicated, but I had to stage different deployments, and this was the only way I knew how with the time and resources available to me.

Question

Why is global.header.php apparently not being served anymore? Could it be some caching setting in WampServer? Or do I need to configure Perch differently?

Thank you.

Paul Lee

Paul Lee 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

This doesn't sound like a Perch issue, you've got an odd setup there which we aren't in the best place to debug.