Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-09-26 16:35:36

yonnermark
Member
Registered: 2006-03-23
Posts: 35

META information for an individual article

I’ve spent ages searching for the answer to this.
And I know it is possible because of this page:
http://textpattern.com/faq/120/is-textpattern-search-engine-friendly

So can some kind person help me figure out who to insert custom meta tags (keywords, description) for each individual article that I create?

Thanks very much for your time
Regards,
Mark

Offline

#2 2008-09-26 16:48:08

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: META information for an individual article

i+m not sure if it’s the best/easiest way, but you could use custom fields and the keywords field and then just use those in your pages, for example:
<META NAME=“KEYWORDSCONTENT=”<txp:keywords />”>


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#3 2008-09-26 17:34:13

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: META information for an individual article

kemie wrote:

<META NAME=“KEYWORDS” CONTENT=”<txp:keywords />”>

or use <txp:meta_keywords /> to output the same thing

You could also use custom fields and call for them to inject metadata, if you need to have more options e.g. for a custom field called meta_description <META NAME=“description” CONTENT=”<txp:custom_field name="meta_description" />”>


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

#4 2008-09-26 18:47:52

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: META information for an individual article

If you use the article excerpt field you can also output that as the description. You need to strip the Textile formatting from it though.

I do that on a site calling the following head_meta form:

<txp:if_individual_article>
<txp:if_excerpt><meta name="description" content="<txp:php>echo strip_tags(excerpt(array()));</txp:php>" /></txp:if_excerpt>
</txp:if_individual_article>

This will output the contents of the excerpt field for individual articles if available.

In my template’s head section I have: <txp:output_form form="head_meta" />

Last edited by masa (2008-09-26 20:29:04)

Offline

#5 2008-09-26 19:25:50

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: META information for an individual article

Or use the rah_metas plugin, and forget about manually doing the boring SEO tasks while at the same time, you boost your SEO (if properly done, of course).


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#6 2008-09-26 22:00:56

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: META information for an individual article

I’m doing it masa’s way, but since more often than not I forgot to fill the excerpt and/or the keywords I use rss_auto_excerpt for description and tru_tags for keywords:

Page:

<txp:if_individual_article>
<txp:output_form form="meta_article" />
<txp:else />
<txp:output_form form="meta_site" />
</txp:if_individual_article>

Form ‘meta_article’:

<meta name="description" content="<txp:rss_auto_excerpt words="25" overrideexcerpt="1" striptags="1" showlinkwithexcerpt="0" stripbreakstabs="1" excerptwraptag="" ending="..." />" />
<meta name="keywords" content="<txp:keywords />" />

Form ‘meta_site’ holds the site wide description and keywords.

Even better would be to also add if_category and if_section specific information.

Last edited by els (2008-09-26 22:03:05)

Offline

#7 2008-09-27 12:06:06

SebastianS
Member
From: Australia
Registered: 2007-10-05
Posts: 46

Re: META information for an individual article

Textpattern is excellent for SEO, a search engine optimisers dream.

This is a summary from “Textpattern section based SEO
by Ralph ‘Deimossystems.com’ The website has been down a while. I just tried the code below on a new site and it works fine.
If you Google “Textpattern section based SEO” my site webdevelopmentnotes will probably come up. Remember the difference between individual articles and sections. Another plugin rah_metas is very good, publishes more meta’s tags, I am used to doing the meta tags this way and it works for me.

1) Please create a new form called: Meta_tags.

Paste following code into your form content:

<txp:if_individual_article> <txp:output_form form=“Meta_Form” /> <txp:else /> <txp:if_section name=”“> <title>Your page title</title> <meta name=“keywords” content=“your keywords, seperated by comma” /> <meta name=“description” content=“description here” /> </txp:if_section> <txp:if_section name=“section name 1”> <title>Your page title</title> <meta name=“keywords” content=“your keywords, seperated by comma” /> <meta name=“description” content=“description here” /> </txp:if_section <txp:if_section name=“section name 2”> <title>Your page title</title> <meta name=“keywords” content=“your keywords, seperated by comma” /> <meta name=“description” content=“description here” /> </txp:if_section> </txp:if_individual_article>

2) Create new form called : Meta_Form Paste following code into your form content:

<title><txp:custom_field name=“title” /></title> <meta name=“description” content=”<txp:custom_field name=“description” />” /> <meta name=“meta_keywords” content=”<txp:custom_field name=“keywords” />” />

3) Copy this line into the section of your page template

<txp:output_form form=“Meta_tags” />

don’t forget to remove old meta tags (title ,keyword, description).

The job is done

Now let me explain how it works
Meta_Form – to use article custom fields to show meta tags for individual articles
Meta_tags – the main form that contains all conditional statements, each statements has meta tags for a different section

You can customize section meta tags by editing conditional statements in the Meta_tags form.

Each “if statement” takes section name as an argument and it should be left empty for the home page.

To adjust meta tags for an individual article you have to fill in custom fields (which you can find under advanced options on the left side of content box) as follows:

Title – custom1
Description – custom2
Keywords – article keywords

There is no need to fill in article custom fields for articles that will not be showed as an individual article”.

I should add, meta tags can often make a big difference to a sites position on Google done properly, relevance.

Last edited by SebastianS (2008-09-27 12:11:27)

Offline

#8 2008-09-28 13:17:07

kevinpotts
Member
From: Ghost Coast
Registered: 2004-12-07
Posts: 370

Re: META information for an individual article

And I know I am shamelessly plugging, but the process of adding keywords and descriptions for every page (including the homepage and section landing pages) is covered in the book.


Kevin
(graphicpush)

Offline

#9 2008-09-29 14:50:01

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: META information for an individual article

My two ‘classics’ on this subject:

Don’t forget to read the comments for updates.


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

Board footer

Powered by FluxBB