Yet Another Technorati Tags MT plugin
He escrito este plugin basado en el trabajo de Kellan Elliot-McCrea que genera las tags de Technorati desde los keywords de una entrada, pero aportando la posibilidad de personalizar el separador de keywords mediante una regexp al estilo de perl, permitiendo usar keyphrases.
I’ve wrote this plugin based on the Kellan Elliot-McCrea’s work. It produces Technorati tags from the entry keywords, but with the possibility to use custom regexps (perl style) to define the keyword separator string, allowing the use of keyphrases.
El uso es muy simple, se define una tag contenedora <MTKeyWordList> que acepta un argumento, pattern que será el que defina la secuencia de caracteres que delimitará nuestros keywords; si omitimos pattern, separará por espacios y/o comas. Otras dos Tags <MTKeyWord> y <MTKeyWordLink> representan el texto del enlace y el enlace, respectivamente.
The use is very simple. There is a container tag <MTKeyWordList> which can take an argument pattern, this one will define the keyword separator string; if we dont provide it then <MTKeyWordList> will use space and comma as delimiters. Another two tags <MTKeyWord> and <MTKeyWordLink> are the tag link text and the link tag into href tag (which may not be exactly the same).
<MTKeyWordList pattern=" *\| *">
<a href="http://technorati.com/tag/<$MTKeyWordLink$>" rel="tag"><$MTKeyWord$></a>
</MTKeyWordList>
Este código genera los enlaces de la caja de texto que hay al final del artículo, dado que la secuencia de caracteres que utilizo para separar mis keywords es ” | “.
El plugin está bajo licencia GPL, y esta es una primera aproximación, que sólo he probado con la version 3.15 de MT. Si tienes algo que aportar, o se te ocurre alguna funcionalidad extra, soy todo oídos.
UPDATE: Kevin Marks, de Technorati, acaba de confirmarme que efectivamente MTKeyWordLink necesita de algunas transformaciones si la tag contiene caracteres extendidos, así que habrá parche asap. Obviamente, si no los usas, funciona perfectamente.
UPDATE (19/02): MTKeyWordLink ahora aparece codificado según la norma URI. Se recomienda usar codificación UTF-8 en el blog, aunque no creo sea estrictamente necesario.
UPDATE (02/03): Ya está disponible la versión php del plugin YATT para MT, así que ya se puede utilizar, con la misma sintaxis, en cualquier tipo de plantilla, ya sea estática o dinámica. Está incluído en el mismo archivo zip.
This code generates the links contained in the box at the end of the article, so, the string I’m using to separate my keywords is ” | “.
The plugin is released under the GPL, and is just a first approach only tested under MT 3.15. If you have something to say, contribute or have any idea that you will like to see on it, please let me know.
UPDATE: Kevin Marks, from Technorati, has just confirmed me that the MTKeyWordLink content may need some transformations if it contains extended characters. If you're not using them, this one will work fine for you, if not there will be a patch asap.
UPDATE (19/02): MTKeyWordLink now is URI-codified. I will recommend to use UTF-8 encoding for your blog, altought I don't think that it's absolutelly necessary.
UPDATE (02/03): Now there is the php version of the YATT MT plugin for dynamic publishing. Same use that the previous release, no hassle. It is included in the same zip file.
Comments
Si no necesitas frases clave, tampoco tienes necesidad de utilizar separadores distintos del espacio, así que puedes dejar MTKeyWordList sin pattern, que separará igual tus palabras clave.
El problema vendría si quisieras usar como keyword, por ejemplo, "fotografía documental" ya que te generaría dos keywords usando el patron por espacios.
Genial, la idea de habilitar un separador para los tags de mas de una palabra me ha parecido muy interesante, pero una pregunta, ¿es posible usar otro campo que no sea el de keywords?. En mi caso lo uso para sacar un listado de entradas relacionadas, y eso me impide cambiar el separador, pero hay otros campor como el de resumen, que nos los uso para nada.
De todas formas, gracias por compartir este trozo de codigo.
Salu2 desde BCN
Yo he separado mis palabras clave simplemente con un espacio... ¿debería añadir algún caracter como | o - entre las palabras clave de todos los post?