Meta Tags, Variables & Static Pages

Creating and modifying plugins.
Post Reply
Michele2
Regular
Posts: 39
Joined: Mon Aug 06, 2007 11:19 pm

Meta Tags, Variables & Static Pages

Post 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?
Michele2
Regular
Posts: 39
Joined: Mon Aug 06, 2007 11:19 pm

Post 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?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Michele2
Regular
Posts: 39
Joined: Mon Aug 06, 2007 11:19 pm

Post 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!!!
Post Reply