Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-07-15 21:59:14

almacmillan
New Member
From: Scotland
Registered: 2008-04-12
Posts: 9
Website

Getting dynamic metadata working in Textpattern

Hi there,

I am a Textpattern newbie and I can’t seem to get dynamic meta keywords and description to work. Where am I going wrong? On my pages I have:

<txp:if_section name=”“> <txp:article_custom section=“homepage” status=“sticky” form=“meta_dynamic” /> <txp:else /> <txp:if_individual_article>
</txp:article status=“sticky” form=“meta_dynamic” />
</txp:if_individual_article>
</txp:if_section>

(meta_dynamic form is just this as an article form:)

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

Can anyone help?

AL

Offline

#2 2008-07-15 22:07:00

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Getting dynamic metadata working in Textpattern

<txp:if_section name="">
    <txp:article_custom section="homepage" status="sticky" form="meta_dynamic" />
<txp:else />
    <txp:if_individual_article>
        <txp:article status="sticky" form="meta_dynamic" />
    </txp:if_individual_article>
</txp:if_section>

You had a typo in the second <txp:article/>. I can’t remember if this kind of nesting works with the 4.0.6 parser though.

Edit: Your article_custom won’t pull the keywords for the current article though – check out rah_metas for a simpler way.

Last edited by jm (2008-07-15 22:09:03)

Offline

#3 2008-07-16 15:34:35

almacmillan
New Member
From: Scotland
Registered: 2008-04-12
Posts: 9
Website

Re: Getting dynamic metadata working in Textpattern

Brilliant Jon-Michael. Great plugin. Thanks so much!

Offline

#4 2008-07-18 19:28:44

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

Re: Getting dynamic metadata working in Textpattern

I don’t know rah_metas yet but you may want to have a look at Trick: Textpattern with page dependent header meta description (and the comments!) which is an older article on performancing.com by me.


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

Offline

Board footer

Powered by FluxBB