Forum

Thread tagged as: Meta, Runway, Blog

Runway Blog Title (layout variables)

Hi,

I've got an issue with a site whereby the blog Title isn't being pulled through on the post page. I'm using layout variables to display them in the header. I will try and be as succinct as I can with my snippets:

global.header:

    <?php 
        if (perch_layout_var('meta', true)) {
            echo perch_layout_var('meta', true);
        } else {
            perch_page_attributes();
        }
    ?>

post.php

<?php 
    $post_slug = perch_get('year').'/'.perch_get('month').'/'.perch_get('s');
    perch_layout('global/header', array(
        'meta'  => perch_blog_custom(array(
                'template' => 'blog/meta.html',
                'filter' => 'postSlug',
                'match' => 'eq',
                'value' => $post_slug,
            ), true),
        ));
?>

blog/meta.html layout

<title><perch:blog id="meta_title" type="textarea" label="Meta Title" size="xs" escape="true" count="chars" /></title>
<meta name="description" content="<perch:blog id="meta_description" type="textarea" label="Meta Description" size="xs" escape="true" count="chars" />" />
<meta name="keywords" content="<perch:blog id="meta_keywords" type="textarea" label="Meta Keywords" size="xs" count="chars" />" />

post.html template

<perch:blog id="meta_title" type="textarea" label="Meta Title" suppress="true" order="4" size="xs" escape="true" />
<perch:blog id="meta_description" type="textarea" label="Meta Description" suppress="true" order="5" size="xs" escape="true" />
<perch:blog id="meta_keywords" type="textarea" label="Meta Keywords" suppress="true" order="6" size="xs" />

Diagnostics

Perch Runway: 2.8.8, PHP: 5.6.8, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.8), assets (2.8.8), categories (2.8.8), perch_blog (4.6), perch_forms (1.8.3), perch_mailchimp (2.0.1), perch_twitter (3.5.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', 'perch_mailchimp', 'perch_twitter' );
PERCH_LOGINPATH: /perch
PERCH_PATH: xxxx/public_html/perch
PERCH_CORE: xxxx/public_html/perch/core
PERCH_RESFILEPATH: /var/sites/w/whatthefoot.co.uk/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 100M, Max POST 100M, Memory: 128M, Total max file upload: 100M
Resource folder writeable: Yes
DOCUMENT_ROOT: xxxx/public_html
HTTP_HOST: www.whatthefoot.co.uk
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Robin Waite

Robin Waite 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

First thing to do would be to try with the current version of Runway.

Hi Drew,

Turns out I simply hadn't uploaded the meta.html file, I hadn't noticed the FTP transfer failed on that one file. Once uploaded everything worked as it should.

I must admit I am apprehensive about updating to the latest version!! Any tips? Or just dive in?!

Regards, Rob

Drew McLellan

Drew McLellan 2638 points
Perch Support

Shouldn't be an issue. Test it in your dev environment first, but I wouldn't expect any problems.