Page 1 of 1

Meta Tags, Variables & Static Pages

Posted: Mon Aug 18, 2008 4:15 pm
by Michele2
I have been creating a few static pages that include a link list of related pages. By default it includes the date of each entry and the title. What I would like to do is include with each entry the meta description to make the list more interesting, informative, and provide more content for SEO purposes.

The link list is created through the staticpages-entries-listing.tpl file that is part of the Static Pages plugin. Can I use the value created by the Meta Tags plugin for the description on that page and what is that variable called and how do I use it?

Posted: Mon Aug 18, 2008 10:49 pm
by Michele2
On a related note, it would appear that the number of entries listed is governed by the same settings as what controls the number of listings displayed on the homepage and categories.

Is there anyway to change things so that on a static page with a related category it could list all of the related entries?

Posted: Tue Aug 19, 2008 10:50 am
by garvinhicking
Hi!

You should be able to do that within the loop in the staticpage-entries-listing.tpl file by using smarty variables:

Code: Select all

{$entry.properties.ep_meta_description}
{$entry.properties.ep_meta_head_title}
{$entry.properties.ep_meta_keywords}
so you'd have something like:

Code: Select all

<a href="{$entry.link}">{$entry.title|@default:$entry.id}</a><br />
Meta-Title: {$entry.properties.ep_meta_head_title}
Is there anyway to change things so that on a static page with a related category it could list all of the related entries?
Somewhere on your plugin_staticpage_related_category.tpl file (or whatever you use as a custom template) you should currently have a code like:

Code: Select all

 {serendipity_fetchPrintEntries category=$staticpage_related_category_id template="staticpage-entries-listing.tpl" limit=5 noSticky="true"}
you need to adapt this to:

Code: Select all

 {serendipity_fetchPrintEntries category=$staticpage_related_category_id template="staticpage-entries-listing.tpl" limit=5000 noSticky="true"}
So you raise the "limit" parameter to something really high. :)

Regards,
Garvin

Posted: Tue Aug 19, 2008 4:07 pm
by Michele2
Oh hurray!!!

The counter change worked perfectly.

The description one didn't work as you had it. When I changed the variable to $entry.properties.meta_description (no ep_ before the field name) it worked perfectly.

Thank you so much for you help!!!