Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#76 2010-09-14 22:00:33
- frickinmuck
- Member

- Registered: 2008-05-01
- Posts: 118
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
AH, the developer does have a keywords field set. Thanks for pointing that out – I’ll tweak. Much appreciated. It’s working beautifully now. Thanks.
The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.
Offline
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
This plugin is always high on my list of “must installs” on every site because it’s so damn handy for us lazy meta geeks. But I have a question which I think has been touched upon throughout the thread and hasn’t quite been addressed (unless I missed it) : duplicate content.
If I use the tag like this:
<txp:rah_metas useauthor="1" description_from="excerpt" description_trail="" words="50" maxchars="512" relnext="Next" relprev="Previous" keywords_replacement="1" keywords="some, nice, words, ..." description="Some natty description" />
then I get the excerpts as meta info on individual article pages (with Some natty description the default if I forget the excerpt, yay!)
But on list pages and the home page I always get Some natty description output. Now, I don’t really mind this because the site is actually about some natty description, but Google’s webmaster tools complain that I have ‘duplicate meta descriptions’ on such pages. And, indeed, on any crawled index pages >1 (i.e. ?pg=2, ?pg=3, etc)
I can see a few ways round this but none are very elegant. They all revolve around putting some conditional tags inside the description attribute like this:
description='<txp:if_section name="about">Natty about description<txp:else /><txp:if_section name="contact">Natty contact description<txp:else />Some natty description</txp:if_section></txp:if_section>'
(which means I can’t use apostrophes in the descriptions unless I escape them or define them in txp:variables earlier, but that’s not a serious probem). All the nesting gets a bit unwieldy, even if I do it inside a variable first.
I could also do the same sort of thing to output no description tag on index pages if so desired, although in this case I have two ways to do it . Firstly:
description='<txp:if_section name="default">Some natty description</txp:if_section>'
But that will probably render an empty description tag instead of ‘no description tag’ on every list page (except home) so webmaster tools will still complain it’s not filled in. The only way I can see round that is to wrap the <txp:if_section> around the <txp:rah_metas /> tag but then I don’t get all the other goodies that rah_metas outputs unless I duplicate the entire tag in the ‘else’ branch(es). And I hate duplicating things, hence the reason I use rah_metas :-)
I wonder if it might be possible to specify some txp:variables before the rah_metas tag and then tell description_from to use them if it finds them in article list mode? Or something else clever like that. I could then, perhaps, make them like this:
<txp:variable name="meta_about">Natty about description</txp:variable>
and tell rah_metas that my variables are of the form meta_<txp:section />. Or something like that. That doesn’t solve the problem of duplicate meta tags on ?pg="2" and beyond, but I have a way round that with smd_if ;-)
There’s probably a much better way to approach all this, but it’s near dinner time and my brain’s slowly giving up for the day. I’m sure, Jukka, that your devious, youthful mind can offer some suitable solutions to my quandary.
Thanks in advance for any advice, dude.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
Hmmm, my brain is jelly now ;-)
Stef, what if you used article or article_custom tags and placed the metas inside articles… or took them from the existing content.
As you probably noticed, some updates ago I added support for the real article context. This means that the tag can be used anywhere as long as $thisarticle is defined.
For example, you could put something like this to your list pages:
<txp:article limit="1" pageby="10">
<txp:rah_metas useauthor="1" description_from="excerpt" description_trail="" words="50" maxchars="512" relnext="Next" relprev="Previous" keywords_replacement="1" keywords="some, nice, words, ..." description="Some natty description" />
</txp:article>
That would take the content from the first article on the page, will it be ?pg=2, ?pg=101 or ?s=lust-and-carrots.
At least that is how I imagine it works. The pageby should solve the pagination issue, and that’s why it’s there, I think.
But that might cause dublicated content with the list pages and individual articles as it steals the metas from the articles (you can change the lenght of the description etc, which does remove the notices from webmaster tools tho).
What if, sticky article could be used, crafted for list use:
<txp:article_custom section='<txp:section />' status="5">
<txp:rah_metas useauthor="1" description_from="excerpt" description_trail="" words="50" maxchars="512" relnext="Next" relprev="Previous" keywords_replacement="1" keywords="some, nice, words, ..." description="Some natty description" />
</txp:article_custom>
That would handle list pages too, expect for pages >1.
I wonder if it might be possible to specify some txp:variables before the rah_metas tag and then tell description_from to use them if it finds them in article list mode? Or something else clever like that. I could then, perhaps, make them like this:
That too is pretty good idea. Me likes, Yoda approves. Hopefully it’s not too much pain in the ass.
Last edited by Gocom (2010-09-22 18:56:30)
Offline
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
Hi, Gocom. I believe I have found a little bug in your plugin.
The first time I used description_from="Descripción" (i.e. the name of my second custom field, “description” in Spanish) nothing happened: there wasn’t any meta description in the code of my page. I tried description_from="Descripcion", without the accent (and changed in the same way the name of my custom field), and still didn’t work. Finally I tried description_from="descripcion", still in Spanish but with a lowercase in the beginning and without accent (and changed the name of my custom field) and it worked. I concluded that there is a serious limitation in the characters you can use in the name of the custom field. On the other hand, I previously used: <meta name="description" content="<txp:custom_field name='Descripción' />" /> (with an accent and an uppercase in the name of the custom field) and it worked fine.
Could you please solve this limitation? Thank you very much.
By the way, if I wanted only use the plugin to achieve a redirection, how would I exclude the description functionality? description_replacement="0" doesn’t work for me. Bye.
Last edited by pompilos (2010-10-17 20:54:20)
Offline
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
pompilos wrote:
Could you please solve this limitation? Thank you very much.
Rah_metas gets the data directly from Textpattern. It takes the info from $thisarticle with the name you provided.
It has to be exact match; the thing is that the keys in $thisarticle array are converted to lowercase according to the server’s locale settings. Using lowercase values in description_from will work.
Might change that in the next release of rah_metas, so that the plugin does lowercasing automatically. I just never have really understood why TXP doesn’t use multibyte save functions.
Thank you for reporting :-)
By the way, if I wanted only use the plugin to achieve a redirection, how would I exclude the description functionality?
By using field name that doesn’t exists. At least it might do it. Not sure tho.
only use the plugin to achieve a redirection
I, personally, wouldn’t use rah_metas just exclusively for redirections. Not the best choise by any means; so much code is ran before rah_metas’ tag (and the redirection) takes place. After all rah_metas is a tag based plugin, sitting there with the other tags. The redirection is more of a extra topping.
Last edited by Gocom (2010-10-18 04:12:55)
Offline
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
Released version 1.4. The update brings some tweaks and fixes. Changelog:
- Now automatically converts values supplied in
keywords_fromanddescription_fromto lowercase. Thank you for reporting, pompilos. - Now uses
lAtts()just once. - Removed dublicated
trim()fromrah_metas_strip(). - Removed
rah_metas_atts().
Offline
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
Thank you for another update. ;)
Just a quick question cuz you know more than me. For the “Copyright” I am using © but it displays like that when viewing the source. Is that expected?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
thebombsite wrote:
Thank you for another update. ;)
Thank you, Stuart :-)
Is that expected?
Yes. It will show exactly what you’re using. If you want to see a bare unicode ©, then use © instead of ©.
Last edited by Gocom (2010-10-19 16:36:55)
Offline
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
Hi, Gocom. Thank you very much for your update. Now the problem explained in #79 is solved: the plugin works fine with an accent and an uppercase in the custom field name. So that I will use it for its primary use too, the creation of meta data. Bye.
Offline
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
Okey dokey Jukka. Thanks again.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#86 2010-10-29 07:35:13
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
i excluded all section urls but sitemap still displaying them. what i’m missing?
Offline
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
Gallex wrote:
i excluded all section urls but sitemap still displaying them. what i’m missing?
If you are refering to rah_sitemap (rah_metas doesn’t generate sitemaps ;-) ), the filtering settings should work just fine.
Make sure that the sitemap isn’t displayed from cache etc. Note that excluding section URLs will exclude just section URLs, not articles. Articles has to be excluded from _“Filter articles from the sitemap”_-section.
Offline
#88 2010-10-29 09:35:40
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
Gocom wrote:
If you are refering to rah_sitemap (rah_metas doesn’t generate sitemaps ;-) ), the filtering settings should work just fine.
yes. sorry for wrong category
Make sure that the sitemap isn’t displayed from cache etc.
that was it :) thanks
Offline
#89 2010-11-01 12:32:35
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
what is wrong in this code, because last part <txp:else /><txp:title /> pildid doesn’t work?
...description='<txp:if_section name="default">Kuup Disain tegeleb peamiselt sisekujundustöödega. Oleme teinud ühiskondlikke projekte, lavakujundusi, messibokside väljapanekuid, kaupluste kujundusi ja kodusid.<txp:else /><txp:if_section name="sisekujundus">Siin lehel näed ülevaadet meie seni tehtud töödest.<txp:else /><txp:title /> pildid</txp:if_section></txp:if_section>'...
Offline
Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools
Gallex wrote:
what is wrong in this code, because last part
<txp:else /><txp:title /> pildiddoesn’t work?
What doesn’t work corretly? What should it do? What is the full code? Yes, the code is valid (in a sense), it does work, but it doesn’t really do anything alone. First of all <txp:title /> is usable only in article context and secondly rah_metas will try to use the article data directly in article context.
Offline