Set Metadata per-page

As of Frog 0.9.3, each page can have its own <meta name="description" ...> and <meta name="keywords"...> fields in the <head> section of the document. This is very useful for those interested in SEO issues.

When you are editing a page, the tab beside the Page Title tab is called Metadata. Click on it, and you find fields for Keywords and a slightly larger text box for Description. Fill the page-specific details here.

Using the Metadata

The simplest code to use in <head> ... </head> section of your document (usually in the Layout for your site) would be:

  <meta name="keywords" content="<?php echo $this->keywords(); ?>" />
  <meta name="description" content="<?php echo $this->description(); ?>" />

This assumes you always use the Metadata fields for every page in your site. If you want to use some standard wording but just vary it occasionally, then use the following:

  <meta name="keywords" content="<?php if ($this->keywords() != '') {
    echo $this->keywords(); }
      else {
    echo 'default, keywords, here'; } ?>" />
  <meta name="description" content="<?php if ($this->description() != '') {
    echo $this->description(); }
      else {
    echo 'Default description goes here'; } ?>" />

This checks to see if there is any Metadata filled in for the page, and if there is, it is used. Otherwise, the default text is used. There are other variations one could use, but these examples should help you get started.


Frog CMS Demo

Public front end website click here
Administration backend click here

Opensource.com admin login info:
login: admin
password: demo123

Help us!

If you use and like Frog CMS, then please consider making a donation.


Click here to lend your support to: Frog CMS and make a donation at www.pledgie.com !