spqr/seo - a few examples

Potentially outdated
This post is older than 365 days and may be outdated. Please use the site-search to search for updated information.
Hello Pagekiteers,
yesterday I released spqr/seo. This extension allows you to add an old-fashioned meta description to your site. You are also able to affect the way how the <title>
is generated.
Let's have a look at the settings.
The extension offers to add a meta description
. If you do so, the og:description
content of the current page is used.
Example:
In this case the content of og:description
is Information about my Pagekit extensions.
If we look at the HTML-source, this Open Graph meta description is inserted just like this:
<meta property="og:description" content="Information about my Pagekit-extensions">
Alright. This is fine, but Open Graph is used by social networks and most search engines are able to read it, but sometimes it's necessary to have an old-fashioned meta description. So enabling the Add Meta Description feature with the option Use Open Graph Description inserts this meta description:
<meta name="description" content="Information about my Pagekit-extensions">
Alright. Now we are going to have a look at the title-rewriting.
If you enable title-rewriting by activating Overwrite Title, you can choose which information should be used to generate your title.
There are 3 possible sources:
- Open Graph Title: og:title
- Sitename: The name of your website
- Pagename: The name of the current node
Each source can have a position that defines the ordering in the title. You may also choose a separator, which divides the parts of the title.
Pagename, Sitename, ... what?!
Let's have a closer look.
This picture shows how to define the Open Graph Title for a page. In this case it's "Creator of Pagekit extensions".
This picture is quite self explanatory. The sitename is "spqr.wtf".
Now let's see what's meant by "Pagename". This is the name of the node itself (not the title). In this case it's "Home".
Examples
Now let's bring things together.
Example 1
- Use Open Graph: Yes
- Position: 1
- Use Sitename: Yes
- Position: 2
- Use Pagename: Yes
- Position: 3
- Separator: " | "
Result: Creator of Pagekit CMS extensions | spqr.wtf | Home
Example 2
- Use Open Graph: Yes
- Position: 3
- Use Sitename: Yes
- Position: 1
- Use Pagename: Yes
- Position: 2
- Separator: " | "
Result: spqr.wtf | Home | Creator of Pagekit CMS extensions
Example 3
- Use Open Graph: No
- Position: -
- Use Sitename: Yes
- Position: 1
- Use Pagename: Yes
- Position: 2
- Separator: " > "
Result: spqr.wtf > Home
Example 4
- Use Open Graph: Yes
- Position: 2
- Use Sitename: Yes
- Position: 1
- Use Pagename: No
- Position: -
- Separator: " - "
Result: spqr.wtf - Creator of Pagekit CMS extensions
That's it
That's it. It looks quite complicated, but as you see it's a good way to overwrite the predefined title. I will add some more features to spqr/seo the next weeks.
I really love to see that some of you are already using this extension. If you would like to see some special features, please use the comment box to propose.
{{ 'Comments (%count%)' | trans {count:count} }}
{{ 'Comments are closed.' | trans }}