Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
jad_metadata
Thought it would be neat to have the use of the meta description and keywords tags in the had section again…the whole semantic web and all, you know. So I made my first plugin:
The tag <code><txp:jad_metadata /></code> goes in the HEAD section, and uses the excerpt for the meta-description tag and a custom field for the meta-keywords tag. By default it uses <code>custom_1</code>, but you can change that by specifying the customid parameter.
Hope it works for you, support will be spotty :)
version 10.3 (4/6/2006):
- fixed bug where textile in excerpts was showing up in the meta tags
- added ability to limit description to a given number of words
- updated help section
Last edited by jdueck (2006-04-06 22:33:55)
Offline
Re: jad_metadata
ok, the excerpt-as-description thing i like. but why not use <txp:meta_keywords /> and just fill in the keywords box in the advanced options on the write page?
Listen to Kenneth
Offline
Re: jad_metadata
well, those keywords were originally for filtering purposes within textpattern, an additional layer of semantic connectivity between articles (as if sections and categories weren’t enough)…
but you see, I’m already using the original keywords on my site to divide articles into “volumes”. So maybe it is just an idiosyncrasy of my usage.
Offline
#4 2004-07-14 09:42:23
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: jad_metadata
I’ve been using the keywords to filter the display of articles, so when I just wanted one article in a category to show up I use the article_custom tag . Is this the right use of keywords or is there a better way to get a specific article to display?
Thanks, Lee.
Offline
Offline
Re: jad_metadata
well, it works for my site :)
how are you using the tag?
Offline
Re: jad_metadata
Works nicely for me, both on RC 1 and RC 3.
The only (minor) problem – if one uses html tags in the excerpt fields, then it badly breaks the validity of a page.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: jad_metadata
I use a php include (head.inc) at the start of each page which has the doctype, head section and then a bit more stuff.
In the head.inc I put <?php echo $metadata; ?>
In the page template I put <?php $metadata = ‘<txp:jad_metadata />’; and then include head.inc.
In custom1 I have written keyword (that’s all)
In excerpt I have written excerpt text (that’s all)
I’ve tried it without the php include but I get the same results. I really need head.inc, though.
Offline
Re: jad_metadata
I use a php include (head.inc) at the start of each page which has the doctype, head section and then a bit more stuff.
In the head.inc I put <code><?php echo $metadata; ?> </code>
In the page template I put <code><?php $metadata = ‘<txp:jad_metadata />’; </code> and then include head.inc.
In custom1 I have keyword
In excerpt I have excerpt text
I’ve tried it without the php include but I get the same results. I really need head.inc, though.
Offline
Re: jad_metadata
I don’t know how any plugin would behave when placed inside an external file and included from the page template. It seems to me that would be flirting with ‘undefined behaviour’.
Are you using any other plugins in this included file, and do they work?
Offline
Re: jad_metadata
phiw13 – thanks for bringing that to my attention. I’ve updated the plugin to strip out HTML & php from the excerpt before it gets put into the meta description tag.
Offline
Re: jad_metadata
Strange… must be me…
I’ve just tried it with the txp:zem_popup_cat plugin and it works fine. It also works fine for txp:page_title, txp:recent_articles and txp:article_custom.
So I deleted jad_metadata and then reinstalled it and now it works!
Nice plugin! And so yes, it does work from inside an include. I’ve just discovered includes. Aren’t they great?!
Offline