Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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: 118

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
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
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: 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

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

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
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
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
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
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

#81 2010-10-19 05:18:55

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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_from and description_from to lowercase. Thank you for reporting, pompilos.
  • Now uses lAtts() just once.
  • Removed dublicated trim() from rah_metas_strip().
  • Removed rah_metas_atts().

More info and downloads

Offline

#82 2010-10-19 15:27:05

thebombsite
Archived 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

Thank you for another update. ;)

Just a quick question cuz you know more than me. For the “Copyright” I am using &copy; 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

#83 2010-10-19 16:34:44

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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 &copy;.

Last edited by Gocom (2010-10-19 16:36:55)

Offline

#84 2010-10-19 21:26:15

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. 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

Board footer

Powered by FluxBB