Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-09-06 07:31:22
- brianlux0r
- Member
- Registered: 2007-06-04
- Posts: 41
section page meta content
Hi,
I know you can create a static like page by just having one article in a section, but is there a way to setup the meta tags for the section page to pull the meta or extra fields variables on the section call page?
Offline
#2 2007-09-06 12:58:27
- kevinmcdougall
- Member
- Registered: 2007-02-08
- Posts: 55
Re: section page meta content
brian, if I understand you correctly you want different metatags for each section?
You could probably achieve this by creating TXP form called metatags, and use the <txp:if_section>
tags to conditionally use specific meta information on a per-section basis eg;
<txp:if_section name="">
<meta name="description" content="The description of my wonderful website" />
<meta name="keywords" content="add,some,keyords,if you,really,want, to use,them" />
</txp:if_section>
<txp:if_section name="about">
<meta name="description" content="The description of my wonderful website" />
<meta name="keywords" content="add,some,keyords,if you,really,want, to use,them" />
</txp:if_section>
<txp:if_section name="news">
<meta name="description" content="The description of my wonderful website" />
<meta name="keywords" content="add,some,keyords,if you,really,want, to use,them" />
</txp:if_section>
Then, refer to it using <txp:output_form form="metatags" />
in the HTML header of your page like so:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="<txp:css />" type="text/css" media="screen" />
<txp:output_form form="metatags" />
<title><txp:sitename /></title>
</head>
That should do it I think.
Kev
Last edited by kevinmcdougall (2007-09-06 12:59:41)
Offline
#3 2007-09-07 03:38:29
- brianlux0r
- Member
- Registered: 2007-06-04
- Posts: 41
Re: section page meta content
that is a stellar idea kev, thanks I was thinking along those lines as a possibility.
I would like to pick your brain on this idea:
Would it be insane to modify /textpattern/index.php?event=section
to have meta content right there for each section?
That would be pretty awsome.
Or, if i limit article to 1 for the section page, and have 1 article appear, is there a way to access the the custom fields of that article through some kind of call on the section page for which that article belongs to?
Offline
Re: section page meta content
Or, if i limit article to 1 for the section page, and have 1 article appear, is there a way to access the the custom fields of that article through some kind of call on the section page for which that article belongs to?
On the head:
<txp:if_individual_article>
<meta name="description" content="<txp:excerpt" />" />
<meta name="keywords" content="<txp:keywords />" />
<txp:else />
<txp:article limit="1" form="metadata" />
</txp:if_individual_article>
and on the article-form named metadata:
<meta name="description" content="<txp:excerpt" />" />
<meta name="keywords" content="<txp:keywords />" />
Or why not using plugins:
Cheers!
Offline
#5 2007-09-07 04:30:57
- brianlux0r
- Member
- Registered: 2007-06-04
- Posts: 41
Re: section page meta content
hello!
i will check it out.
thanks buddy!!
Offline
#6 2007-09-07 12:22:38
- kevinmcdougall
- Member
- Registered: 2007-02-08
- Posts: 55
Re: section page meta content
Brian,
More I think about it, the more ways I think this could be done, guess it’s down to finding which suits the application best. Gocom’s idea is pretty slick, but I personally like to keep txp:excerpt and txp:keywords reserved for other purposes.
I don’t think modifying the TXP files would give you any advantage over the various methods possible using native tags or plugins. I will take a look at rah_metas too Gocom, could be handy.
Kev
Last edited by kevinmcdougall (2007-09-07 12:29:22)
Offline
Re: section page meta content
There is an article by Nathan Smith that could be helpful:
Offline
Pages: 1