Textpattern CMS support forum

You are not logged in. Register | Login | Help

#71 2010-05-23 19:47:46

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

Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools

Gocom wrote:

Version 1.3 was just released. Changelog like list of things:

  • Now description_from and keywords_from take comma seperated list of fields. The first field in the list that isn’t empty is used as keywords or description.
  • Removed attribute prefercontent. Using the attribute will throw notice in testing and debugging mode.

Great, Gocom.
Thanks again for accepting the request and pushing it into rah_metas.

I think this new way (a comma-separated list of explicit values on description_from or keyword_from attr) makes it much more easier to understand where the description/keywords are coming from.

A note for those upgrading (Gocom, correct me if I’m wrong): now, if you would like to have some “fall back” content for your meta description/keywords, you have to make it explicitly in your description_from or keywords_from attribute.
In other words, if you just do description_from="my_custom_field" and my_custom_field is left empty, then you won’t get any description from body or excerpt.

PS: Gocom, you may also want to remove the prefercontent example in rah_metas’ page.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#72 2010-05-23 23:10:07

thebombsite
Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools

Shoot! Why didn’t I think of that? I mean it’s just what my form is doing. Bugger!

Thanks for the reminding me I can use tags-within- tags Jukka.

Working too much with all this jiggery-pokery WP code is what it is. Bugger, bugger, bugger! ;)

Last edited by thebombsite (2010-05-23 23:12:52)


Stuart – The BombsiteProText ThemesTextgarden

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#73 2010-06-23 14:09:31

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools

Thanks for plugin!

Feature idea:
description_replacement="2" – append description_from to description (description – first, description_from – second)
keywords_replacement="2" – append keywords_from to keywords


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#74 2010-09-14 21:12:49

frickinmuck
Member
Registered: 2008-05-01
Posts: 107

Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools

I LOVE this plugin, but I’m not getting the results I expect, and I’m wondering if I’m doing something wrong. I have it set with “default” description and keywords (set in those attributes), and I’m using a custom field and the keywords field to replace those respective items when available. It’s working beautifully with the custom field, but the keywords field content isn’t appearing. It only ever shows the keywords list that was set in the tag. Here’s my tag, for your reference:

<txp:rah_metas keywords_replacement="1" description_replacement="1" keywords="septic system,septic systems,septic tank,septic tanks,septic,leaching bed,wastewater treatment,wastewater,replace septic system,septic tank system,septic sewage,aerobic septic system,aerobic septic systems,sewer,septic company,well,septic service,septic tank odor,septic system design,septic tank problem,install septic system" description="Septic systems can be environmentally friendly, effective and economical. This website details the components, operation, and proper maintenance of an inground septic tank and system." description_from="meta_description" keywords_from="keywords" />

Any idea what I could be doing wrong?


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

#75 2010-09-14 21:29:35

Gocom
Plugin Author
Registered: 2006-07-14
Posts: 4,524
Website

Re: rah_metas // new 1.x-versions of SEO/redirecting/automatic meta-tools

frickinmuck wrote:

It’s working beautifully with the custom field, but the keywords field content isn’t appearing. It only ever shows the keywords list that was set in the tag.

That’s odd. The code definetly should work (works here).

Any idea what I could be doing wrong?

Do you happen to have a custom field named “keywords”? Some names are reserved (see the list here) and will conflict with other article tags/data.

Last edited by Gocom (2010-09-14 21:33:53)

Offline

#76 2010-09-14 22:00:33

frickinmuck
Member
Registered: 2008-05-01
Posts: 107

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

#77 2010-09-22 16:43:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,312
Website

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#78 2010-09-22 18:39:09

Gocom
Plugin Author
Registered: 2006-07-14
Posts: 4,524
Website

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

#79 2010-10-17 20:53:35

pompilos
Member
From: Spain
Registered: 2005-06-07
Posts: 114
Website

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

#80 2010-10-18 04:06:59

Gocom
Plugin Author
Registered: 2006-07-14
Posts: 4,524
Website

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

Board footer

Powered by FluxBB