Forum

Thread tagged as: Question, Addons, Meta

Trying to use blog excerpt as meta description for blog

I'm not sure what I'm missing but I'm getting no output in my generated html markup for meta description.

blog/post.php has this

<title><?php perch_blog_post_field(perch_get('s'), 'postTitle'); ?></title>
    <meta name="description" content="<?php 
    perch_blog_custom(array(
        'filter'=>'postSlug',
        'match'=>'eq',
        'value'=>perch_get('s'),
        'template'=>'excerpt.html',
    ));
    ?>">

In post.html the excerpt field looks like this:

<perch:blog id="excerpt" type="textarea" label="Excerpt" html="true" order="3" suppress="true" size="s" />

And I have a blog template excerpt.html that looks like this:

<perch:blog id="excerpt" type="textarea" label="Excerpt"  html="true" striptags="true" />

After I save my blog post, the html then looks like this:

<title>Welcome to my new website</title>
    <meta name="description" content="">

I'd welcome any ideas!

Summary information

    Perch: 2.8.15, PHP: 5.4.33, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $, with PDO
    Server OS: Linux, cgi-fcgi
    Installed apps: content (2.8.15), assets (2.8.15), categories (2.8.15), perch_blog (5.0), perch_gallery (2.8.6)
    App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_gallery', 'perch_blog', );
    PERCH_LOGINPATH: /admin
    PERCH_PATH: /home/amodeowe/public_html/tw/admin
    PERCH_CORE: /home/amodeowe/public_html/tw/admin/core
    PERCH_RESFILEPATH: /home/amodeowe/public_html/tw/admin/resources
    Image manipulation: GD
    PHP limits: Max upload 40M, Max POST 20M, Memory: 128M, Total max file upload: 20M
    Resource folder writeable: Yes
    HTTP_HOST: www.tw.hardingweb.net
    DOCUMENT_ROOT: /home/amodeowe/public_html/tw
    REQUEST_URI: /admin/core/settings/diagnostics/
    SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
Nigel Harding

Nigel Harding 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

If you turn on debug, does that reveal anything?