<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>Adyax Blog</title>
	<atom:link href="http://blog.adyax.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.adyax.com</link>
	<description>Méthodes agiles, Drupal, Magento, J2ME, Ergonomie et Utilisabilité</description>
	<pubDate>Thu, 04 Mar 2010 11:42:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Lancement de Adyax Cloud Search</title>
		<link>http://blog.adyax.com/2010/02/lancement-de-adyax-cloud-search-sur-gouvernementfr/</link>
		<comments>http://blog.adyax.com/2010/02/lancement-de-adyax-cloud-search-sur-gouvernementfr/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 12:46:15 +0000</pubDate>
		<dc:creator>Jean-Baptiste Guerraz</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<category><![CDATA[Etude de cas]]></category>

		<category><![CDATA[Références]]></category>

		<category><![CDATA[Apache SOLR]]></category>

		<category><![CDATA[Cloud Computing]]></category>

		<guid isPermaLink="false">http://blog.adyax.com/?p=278</guid>
		<description><![CDATA[Depuis ce matin, nous avons lancé un nouveau produit :  Adyax Cloud Search.
Le principe est simple : un Apache SOLR hébergé sur le cloud Amazon EC2.
Nous avons travaillé depuis plusieurs mois pour mettre en place une architecture d&#8217;haute disponibilité avec une optimisation des ressources EC2, pour en optimiser les coûts. Coté Drupal, rien de particulier à faire, [...]]]></description>
			<content:encoded><![CDATA[<p>Depuis ce matin, nous avons lancé un nouveau produit :  <strong>Adyax Cloud Search</strong>.</p>
<p>Le principe est simple : un <strong><a title="Moteur de recherche Open Source" href="http://lucene.apache.org/solr/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://lucene.apache.org/solr/');">Apache SOLR</a></strong> hébergé sur le <a title="Cloud Computing" href="http://aws.amazon.com/ec2/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://aws.amazon.com/ec2/');">cloud Amazon EC2</a>.</p>
<p>Nous avons travaillé depuis plusieurs mois pour mettre en place une architecture d&#8217;haute disponibilité avec une optimisation des ressources EC2, pour en optimiser les coûts. Coté <strong>Drupal</strong>, rien de particulier à faire, car on se base sur le <a title="Module Apache SOLR pour Drupal" href="http://drupal.org/project/apachesolr" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://drupal.org/project/apachesolr');">module </a><strong><a title="Module Apache SOLR pour Drupal" href="http://drupal.org/project/apachesolr" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://drupal.org/project/apachesolr');">Apache SOLR</a></strong> de base.</p>
<p><strong>Les fonctionnalités d&#8217;Adyax Search</strong></p>
<ul>
<li>Moteur basé sur Apache Lucene SOLR</li>
<li>Lemmatisation des expressions françaises</li>
<li>Recherche par facettes</li>
<li>Recherche par catégories</li>
<li>Liberté totale sur le paramétrage de la pertinence, catégories, types de contenus</li>
<li>Indexation de fichiers PDF, XLS, DOC, RTF…</li>
<li>Rapidité d&#8217;execution des requêtes</li>
<li>Rapidité d&#8217;indexation</li>
</ul>
<p><strong>Adyax Cloud Search vs Apache SOLR installé chez vous</strong></p>
<p><em>Haute disponibilité et gestion des piques de trafic :</em></p>
<ul>
<li>Le service de recherche est hébergé sur la plateforme Amazon EC2, ce qui offre un taux de disponibilité de 99,95%</li>
<li>Par ailleurs grâce à notre système de load-balancing EC2 la plateforme est capable de prendre en charge n’importe quel pic de trafic</li>
</ul>
<p><em>Economies importantes :</em></p>
<ul>
<li>Pas de frais d’infogérance</li>
<li>Une intégration simplissime : vous activez un module <strong>Drupal</strong> et le moteur de recherche fonctionne !</li>
<li>Vous ne payez que ce que vous consommez : pour tenir la charge durant les heures chargées ou lors d’un pic de trafic, vous ne payez que les ressources consommées, sans supporter le cout d’un matériel inutilisé le reste du temps</li>
<li>Une structure de très prix simple</li>
<li>Grace à un système de cache embarqué, les requêtes déjà effectuées ne sont pas payées !</li>
<li>Totale transparence : une facture détaillée avec tous vos consommations mensuelles.</li>
</ul>
<div><strong>Gestion des pics de charge</strong></div>
<div>Le moteur de recherche est dupliqué avec les indexes sur des instances, chaque instance peut traiter un certain nombre de requêtes simultanées.</div>
<div>
<p class="MsoNormal"><span lang="FR">Lorsque le système de répartition de charge constate un accroissement fort de trafic et que les ressources allouées ne suffisent plus, d’autres instances sont lancées et prennent en charge les nouvelles requêtes.</span></p>
<p class="MsoNormal"><span lang="FR">Grace à l’architecture « cloud » de Amazon EC2, le nombre d’instances disponibles est quasiment illimité. Ainsi, toutes ressources non utilisée est désactivée et donc non facturée.</span></p>
<p class="MsoNormal"><span lang="FR"><strong>Pour en savoir plus sur l&#8217;offre Adyax Search, n&#8217;hésitez pas à nous contacter : <a title="Ouvre votre logiciel de mail" href="mailto:contact@adyax.com">contact@adyax.com</a> ou <a title="Contactez Adyax" href="http://www.adyax.com/fr/contactez-nous" >http://www.adyax.com/fr/contactez-nous</a></strong></span></p>
<p><!--EndFragment--></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.adyax.com/2010/02/lancement-de-adyax-cloud-search-sur-gouvernementfr/feed/</wfw:commentRss>
		</item>
		<item>
		<title>World Food Programme, version multilingue</title>
		<link>http://blog.adyax.com/2009/11/world-food-program-version-multilingue/</link>
		<comments>http://blog.adyax.com/2009/11/world-food-program-version-multilingue/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 22:12:23 +0000</pubDate>
		<dc:creator>Nicolas Guerrier</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<category><![CDATA[Etude de cas]]></category>

		<guid isPermaLink="false">http://blog.adyax.com/?p=273</guid>
		<description><![CDATA[Nous sommes très heureux de voir en ligne la version multilingue du site de l&#8217;association de l&#8217;ONU : Programme Mondial contre la Faim (WFP). Quelques mois d&#8217;efforts et c&#8217;est un site en plus de 10 langues qui est en ligne.
http://es.wfp.org/
Pour l&#8217;instant seule la version espagnole a été migrée (les autres langues allant vers les anciennes [...]]]></description>
			<content:encoded><![CDATA[<p>Nous sommes très heureux de voir en ligne la version multilingue du site de l&#8217;association de l&#8217;ONU : Programme Mondial contre la Faim (WFP). Quelques mois d&#8217;efforts et c&#8217;est un site en plus de 10 langues qui est en ligne.</p>
<p><a title="WFP multilingue sous Drupal" href="http://es.wfp.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://es.wfp.org/');" target="_blank">http://es.wfp.org/</a></p>
<p>Pour l&#8217;instant seule la version espagnole a été migrée (les autres langues allant vers les anciennes versions, en attendant la migration de tous les sites).</p>
<p>La principale difficulté aura été de gérer les fontes non standard pour les titres. Il a été particulièrement difficile de trouver une fonte qui corresponde graphiquement et qui contienne tous les jeux de caractères (coréen, russe, arabe, français, chinois&#8230;.)</p>
<p>L&#8217;autre tâche complexe est liée au fait que les différentes sous-organisations ne rédigent pas le même volume de contenu, il a fallu donc adapter les pages d&#8217;accueil des différentes langues en fonction de la quantité de contenu disponible.</p>
<p>Longue vie à cette belle association qui oeuvre chaque jour contre la faim dans le monde.</p>
<div id="attachment_274" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.adyax.com/wp-content/uploads/2009/11/capture-de28099ecran-2009-11-15-a-230308.png" ><img class="size-medium wp-image-274" title="WFP - World Food Program, Spanish version" src="http://blog.adyax.com/wp-content/uploads/2009/11/capture-de28099ecran-2009-11-15-a-230308-300x204.png" alt="WFP un site avec une dizaine de langues sous Drupal" width="300" height="204" /></a><p class="wp-caption-text">WFP un site avec une dizaine de langues sous Drupal</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.adyax.com/2009/11/world-food-program-version-multilingue/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rapport annuel sur l&#8217;adoption et la popularité des CMS</title>
		<link>http://blog.adyax.com/2009/11/rapport-annuel-sur-ladoption-et-la-popularite-des-cms/</link>
		<comments>http://blog.adyax.com/2009/11/rapport-annuel-sur-ladoption-et-la-popularite-des-cms/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 11:57:13 +0000</pubDate>
		<dc:creator>Maxime Topolov</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<category><![CDATA[Etude de cas]]></category>

		<guid isPermaLink="false">http://blog.adyax.com/?p=266</guid>
		<description><![CDATA[Le nouveau rapport OSS CMS Report 2009 vient de paraitre (en anglais). Très complet, on y découvre, sans surprise la prédominance des trois grands : WordPress, Joomla! et Drupal.
On remarque aussi que Joomla! est devant Drupal sur pas mal de critères. Je ne suis pas vraiment étonné de ce positionnement, Drupal reste surtout utilisé par [...]]]></description>
			<content:encoded><![CDATA[<p>Le nouveau rapport <a href="http://blog.adyax.com/wp-content/uploads/2009/11/osscmsreport2009r2.pdf" onclick="javascript:pageTracker._trackPageview('/downloadsblog./wp-content/uploads/2009/11/osscmsreport2009r2.pdf');">OSS CMS Report 2009</a> vient de paraitre (en anglais). Très complet, on y découvre, sans surprise la prédominance des trois grands : WordPress, Joomla! et <a title="Prestataire Drupal, numéro un sur Drupal en Europe" href="http://www.adyax.com/drupal"  target="_self">Drupal</a>.</p>
<div id="attachment_269" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.adyax.com/wp-content/uploads/2009/11/capture-de28099ecran-2009-11-09-a-125805.png" ><img class="size-medium wp-image-269" title="Les principaux CMS calssés en trois catégories : Leaders, Challengers, Sortants" src="http://blog.adyax.com/wp-content/uploads/2009/11/capture-de28099ecran-2009-11-09-a-125805-300x117.png" alt="Tendance confirmée, Wordpress, Drupal &amp; Joomla! loin devant" width="300" height="117" /></a><p class="wp-caption-text">Tendance confirmée, Wordpress, Drupal &amp; Joomla! loin devant</p></div>
<p>On remarque aussi que Joomla! est devant <a title="Prestataires Drupal" href="http://www.adyax.com/drupal" >Drupal</a> sur pas mal de critères. Je ne suis pas vraiment étonné de ce positionnement, <a title="Formation Drupal" href="http://www.adyax.com/drupal" >Drupal</a> reste surtout utilisé par des professionnel pour des sites importants. On voit d&#8217;ailleurs, que le rapport place ezPublish &amp; Typo3 loin derrière, alors que ces CMS sont souvent des concurrents sérieux de <a title="Drupal, le meilleur CMS Open Source" href="http://www.adyax.com/drupal" >Drupal</a> sur les appels d&#8217;offres d&#8217;envergure.</p>
<p>En revanche, petite surprise, Drupal est largement en tête pour les mesures de marque.</p>
<div id="attachment_270" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.adyax.com/wp-content/uploads/2009/11/capture-de28099ecran-2009-11-09-a-130014.png" ><img class="size-medium wp-image-270" title="CMS sur le micro-blogging" src="http://blog.adyax.com/wp-content/uploads/2009/11/capture-de28099ecran-2009-11-09-a-130014-300x187.png" alt="CMS sur le micro-blogging, domination écrasante des 3 leaders" width="300" height="187" /></a><p class="wp-caption-text">CMS sur le micro-blogging, domination écrasante des 3 leaders</p></div>
<p>Par ailleurs, et cela confirme mon sentiment vis-à-vis des divers CMS,  <a title="Sites sous Drupal" href="http://www.adyax.com/drupal" >Drupal</a> est devant Joomla!, Typo, ezPublish en termes de qualité. En effet, les personnes ont généralement tendance à préférer <a title="Modules Drupal" href="http://www.adyax.com/drupal" >Drupal</a>, une fois le logiciel installé et utilisé.</p>
<div id="attachment_268" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.adyax.com/wp-content/uploads/2009/11/capture-de28099ecran-2009-11-09-a-120512.png" ><img class="size-medium wp-image-268" title="Réponses à la question : Quel est votre sentiment à l'égard des différents projets ?" src="http://blog.adyax.com/wp-content/uploads/2009/11/capture-de28099ecran-2009-11-09-a-120512-300x227.png" alt="Rouge = negatif, Vert = positif" width="300" height="227" /></a><p class="wp-caption-text">Rouge = negatif, Vert = positif</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.adyax.com/2009/11/rapport-annuel-sur-ladoption-et-la-popularite-des-cms/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Les étudiants de Paris sous Drupal !</title>
		<link>http://blog.adyax.com/2009/07/les-etudiants-de-paris-sous-drupal/</link>
		<comments>http://blog.adyax.com/2009/07/les-etudiants-de-paris-sous-drupal/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 23:30:19 +0000</pubDate>
		<dc:creator>Arthur Murauskas</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<category><![CDATA[Etude de cas]]></category>

		<category><![CDATA[PDF]]></category>

		<category><![CDATA[Print]]></category>

		<category><![CDATA[Sign-up]]></category>

		<category><![CDATA[Views]]></category>

		<guid isPermaLink="false">http://blog.adyax.com/?p=255</guid>
		<description><![CDATA[Le site de l&#8217;étudiant de Paris passe sous Drupal. Les étudiants ont désormais accès à de nombreuses ressources en plusieurs langues. Mais aussi à un forum et un agenda interactif. Nous sommes très heureux de voire ce site enfin enligne après quelques semaines d&#8217;efforts intenses. Bravo au CROUS et à la Mairie de Paris pour [...]]]></description>
			<content:encoded><![CDATA[<p>Le <a title="Le site des étudiants à Paris" href="http://www.etudiantdeparis.fr/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.etudiantdeparis.fr/');" target="_blank">site de l&#8217;étudiant de Paris</a> passe sous <a title="Préstataires Drupal, experts Drupal" href="http://www.adyax.com/drupal"  target="_self">Drupal</a>. Les étudiants ont désormais accès à de nombreuses ressources en plusieurs langues. Mais aussi à un forum et un agenda interactif. Nous sommes très heureux de voire ce site enfin enligne après quelques semaines d&#8217;efforts intenses. Bravo au <strong>CROUS</strong> et à la <strong>Mairie de Paris</strong> pour cette initiative originale !</p>
<p>Petite difficulté - la gestion du menu assez imposant et très sympa avec des images et pas mal de contenu. Ici on massivement utilisé <strong>Views</strong>, le menu classique de Drupal étant laissé pour la gestion des liens dans le footer.</p>
<p>La gestion de l&#8217;agenda et des inscriptions utilise le module <strong>Sign-up</strong>. L&#8217;export <em>PDF</em> de tous les articles du site est assuré par le module <strong>Print</strong> avec l&#8217;utilisation d&#8217;un template spécial, adapté à l&#8217;impression.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adyax.com/2009/07/les-etudiants-de-paris-sous-drupal/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Intégration de Drupal avec Magento</title>
		<link>http://blog.adyax.com/2009/06/integration-de-drupal-avec-magento/</link>
		<comments>http://blog.adyax.com/2009/06/integration-de-drupal-avec-magento/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 00:34:41 +0000</pubDate>
		<dc:creator>Maxime Topolov</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<category><![CDATA[magento]]></category>

		<category><![CDATA[API]]></category>

		<category><![CDATA[eCommerce]]></category>

		<guid isPermaLink="false">http://blog.adyax.com/?p=252</guid>
		<description><![CDATA[Nous sommes très heureux de mettre à disposition de la communauté la suite de modules et d&#8217;extensions permettant l&#8217;intégration complète entre Magento et Drupal.
Après plusieurs mois d&#8217;efforts, les deux cotés du tunnel se sont enfin rejoint : un module Magento pour Drupal et une extension Drupal pour Magento.
En installant les deux, vous aurez la possibilité [...]]]></description>
			<content:encoded><![CDATA[<p>Nous sommes très heureux de mettre à disposition de la communauté la suite de modules et d&#8217;extensions permettant l&#8217;intégration complète entre <a href="http://www.magentocommerce.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.magentocommerce.com');">Magento</a> et <a href="http://www.drupal.org" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.drupal.org');">Drupal</a>.</p>
<p>Après plusieurs mois d&#8217;efforts, les deux cotés du tunnel se sont enfin rejoint : un <a href="http://www.drupal.org/project/magento" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.drupal.org/project/magento');">module <strong>Magento</strong> pour <strong>Drupal</strong></a> et une <a href="http://www.magentocommerce.com/extension/1020/drupal" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.magentocommerce.com/extension/1020/drupal');">extension <strong>Drupal</strong> pour <strong>Magento</strong></a>.</p>
<p>En installant les deux, vous aurez la possibilité d&#8217;utiliser <strong>Magento</strong> comme <em>back office</em> de gestion de votre boutique et <strong>Drupal</strong> pour le <em>front office</em>.</p>
<p><strong>Les avantages de cette solution sont nombreux :</strong></p>
<ul>
<li><strong>Totale souplesse sur le contenu</strong> : vous n&#8217;êtes plus limités par les lacunes &#8216;CMS&#8217; de <strong>Magento</strong>. Vous bénéficiez de la toute puissance de Drupal pour gérer votre contenu, promouvoir vos produits et construire des solution eCommerce aussi complexes que vous le souhaitez</li>
<li><strong>Puissance de Magento</strong> : s&#8217;il existe des modules eCommerce pour <strong>Drupal</strong> (Ubercart, eCommerce), il n&#8217;en reste pas moins des extension du CMS. Les interfaces et fonctionnalités ne peuvent pas concurrencer <strong>Magento</strong>, surtout pour des sites d&#8217;envergure.</li>
<li><strong>Sécurité</strong> : les deux plateformes (<em>front</em> &amp; <em>back</em>) peuvent résider sur deux serveurs distincts, le <em>back</em> n&#8217;est <strong>jamais directement atteint par les internautes</strong>. Enfin, une faille sur le <em>front</em> ne remet pas en danger l&#8217;intégralité de votre solution, votre catalogue, prix, règles de gestion et, surtout, <strong>vos clients sont protégés</strong> sur le <em>back</em>, éventuellement derrière un parfeu.</li>
<li><strong>Optimisation</strong> : <strong>Magento</strong> a souvent péché par la lenteur, ce qui n&#8217;est pas le cas de <strong>Drupal</strong>. Séparer les briques <em>front</em> &amp; <em>back</em> permet d&#8217;optimiser l&#8217;utilisation des ressources, mais surtout offre une opportunité simple de mise en place d&#8217;architectures hautement distribuées (rien ne vous empêche d&#8217;avoir 3 <em>front office</em> <strong>Drupal</strong> avec 1 <em>back office</em> <strong>Magento</strong>.)</li>
</ul>
<p><strong>Modules Drupal</strong> : <a href="http://www.drupal.org/project/magento" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.drupal.org/project/magento');">http://www.drupal.org/project/magento</a><br />
<strong>Extension Magento</strong> : <a href="http://www.magentocommerce.com/extension/1020/drupal" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.magentocommerce.com/extension/1020/drupal');">http://www.magentocommerce.com/extension/1020/drupal</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adyax.com/2009/06/integration-de-drupal-avec-magento/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Adyax devient Gold Partner de Acquia</title>
		<link>http://blog.adyax.com/2009/04/adyax-devient-gold-parner-de-acquia/</link>
		<comments>http://blog.adyax.com/2009/04/adyax-devient-gold-parner-de-acquia/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 10:03:06 +0000</pubDate>
		<dc:creator>Yann Perron</dc:creator>
		
		<category><![CDATA[Non classé]]></category>

		<category><![CDATA[Acquia]]></category>

		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://blog.adyax.com/?p=225</guid>
		<description><![CDATA[Adyax est heureux d&#8217;annoncer la signature d&#8217;un accord avec l&#8217;éditeur d&#8217;une offre commerciale Drupal, Acquia. Nous devenons le premier partenaire &#8220;Gold&#8221; français et renforçons ainsi notre position de leader sur le marché.
Acquia a été fondé et est dirigé notamment par Dries Buytaert, le créateur de Drupal.
Après des semaines de discussions pendant lesquelles Acquia a vérifié nos [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.adyax.com" >Adyax</a> est heureux d&#8217;annoncer la signature d&#8217;un accord avec l&#8217;éditeur d&#8217;une offre commerciale <a href="http://www.adyax.com/drupal" >Drupal</a>, <a href="http://www.acquia.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.acquia.com');">Acquia</a>. Nous devenons le premier partenaire &#8220;Gold&#8221; français et renforçons ainsi notre position de leader sur le marché.</p>
<p><a href="http://www.acquia.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.acquia.com');">Acquia</a> a été fondé et est dirigé notamment par Dries Buytaert, le créateur de <a href="http://www.adyax.com/drupal" >Drupal</a>.</p>
<p>Après des semaines de discussions pendant lesquelles Acquia a vérifié nos références, interviewé nos clients, étudié notre expertise sur le CMS, le partenariat a été enfin signé.</p>
<p>Ce partenariat servira à nos clients les plus fortunés qui souhaitent bénéficier d&#8217;un support 24/24, multi-niveaux. Il servira aussi à rassurer les clients qui en ont encore besoin sur la pérennité de <a href="http://www.adyax.com/drupal" >Drupal</a> : Il est aujourd&#8217;hui possible d&#8217;avoir le support commercial d&#8217;un éditeur sur <a href="http://www.adyax.com/drupal" >Drupal</a>, comme ça peut déjà être le cas pour des solutions open source comme Linux ou MySql.</p>
<p>Plus d&#8217;infos sur www.acquia.com</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adyax.com/2009/04/adyax-devient-gold-parner-de-acquia/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[English] Ruby Cucumber: New approach in Ruby testing</title>
		<link>http://blog.adyax.com/2009/03/ruby-cucumber/</link>
		<comments>http://blog.adyax.com/2009/03/ruby-cucumber/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 09:40:04 +0000</pubDate>
		<dc:creator>Arthur Murauskas</dc:creator>
		
		<category><![CDATA[Posts in English]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[Tutoriél vidéo]]></category>

		<category><![CDATA[bdd]]></category>

		<category><![CDATA[English]]></category>

		<category><![CDATA[tdd]]></category>

		<category><![CDATA[testing]]></category>

		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.adyax.com/?p=193</guid>
		<description><![CDATA[No, I&#8217;m not going to talk about cookery or how to cook 10 dishes with cucumbers or any other vegetables, though it could be a perfectly respectable topic  Instead I will show you a new approach in Ruby testing - Cucumber, which is designed to allow you writing BDD tests on a high level [...]]]></description>
			<content:encoded><![CDATA[<p>No, I&#8217;m not going to talk about cookery or how to cook 10 dishes with cucumbers or any other vegetables, though it could be a perfectly respectable topic <img src='http://blog.adyax.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Instead I will show you a new approach in Ruby testing - Cucumber, which is designed to allow you writing BDD tests on a high level of abstraction (as a plain-text documents).</p>
<p><span id="more-193"></span>Lets take look at one of the <a href="http://github.com/aslakhellesoy/cucumber/tree/master/examples" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://github.com/aslakhellesoy/cucumber/tree/master/examples');" target="_blank">example features</a> provided with cucumber package:</p>
<pre>Feature: Cucumber
  In order to have a happy user base
  As a Cucumber user
  I don't want no stinkin bugs

  Scenario: Reading a table
    Given the following table
      | born  | working |
      | Oslo  | London  |</pre>
<p>It doesn&#8217;t look like a normal test, isn&#8217;t it? Lets play with it a little bit more.</p>
<p>First of all we need to install (I assume that you already have ruby and rubygems packages installed) Cucumber running command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> cucumber mechanize</pre></div></div>

<p>Create a directory tree for your example project:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> cucumber_test<span style="color: #000000; font-weight: bold;">/</span>features<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>step_definitions,support<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>Now lets write our first scenario, describing search process in Google (I&#8217;m taking an idea for this test from Cucumber examples):</p>
<pre>Feature: Search
  In order to learn more
  As an information seeker
  I want to find more information

  Scenario: Find what I'm looking for
    Given I am on the "http://google.com" page
    When I search for "drupal magento flex" in form with name "f"
    Then I should see a link to "Adyax :: Drupal Magento Flex Asterisk J2ME web mobile developement ...":http://www.adyax.com/</pre>
<p>You&#8217;ll need a rake file to run your tests:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'cucumber/rake/task'</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">Cucumber::Rake::Task</span>.<span style="color:#9900CC;">new</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>t<span style="color:#006600; font-weight:bold;">|</span>
  t.<span style="color:#9900CC;">cucumber_opts</span> = <span style="color:#996600;">&quot;--format pretty&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Lets run it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ rake features</pre></div></div>

<p>If there weren&#8217;t any errors then everything is OK; rake told us that we have no scenarios so lets create one. Create a file search.feature in features directory:</p>
<pre>Feature: Search
  In order to learn more
  As an information seeker
  I want to find more information

  Scenario: Find what I'm looking for
    Given I am on the "http://google.com" page
    When I search for "drupal magento flex" in form with name "f"
    Then I should see a link to "Adyax :: Drupal Magento Flex Asterisk J2ME web mobile developement ...":http://www.adyax.com/

  Scenario: Find a module
    Given I am on the "http://drupal.org/project/Modules" page
    When I search for "xmlsitemap" in form with method "POST" and action "/project/Modules"
    Then I should see a link to "XML Sitemap":http://drupal.org/project/xmlsitemap</pre>
<p>Now you can run &#8220;rake features&#8221; again:</p>
<p style="text-align: center;"><a href="http://blog.adyax.com/wp-content/uploads/2009/03/cucumber1.jpeg" ><img class="size-full wp-image-194 aligncenter" title="rake features with no step definitions" src="http://blog.adyax.com/wp-content/uploads/2009/03/cucumber1.jpeg" alt="rake features with no step definitions" width="590" height="261" /></a></p>
<p>Our next task is to create step definitions for our scenario but before we need to prepare our working environment. Create file env.rb in features/support directory:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'spec/expectations'</span>
<span style="color:#008000; font-style:italic;"># We are using Mechanize library for navigating through pages</span>
<span style="color:#008000; font-style:italic;"># Alternatively you can use any other library including: watir, webrat, selenium</span>
<span style="color:#008000; font-style:italic;"># Check the full list and documentation here: http://wiki.github.com/aslakhellesoy/cucumber</span>
<span style="color:#008000; font-style:italic;"># Examples of using Cucumber: http://github.com/aslakhellesoy/cucumber/tree/master/examples</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'mechanize'</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># before &quot;all&quot;</span>
agent = <span style="color:#6666ff; font-weight:bold;">WWW::Mechanize</span>.<span style="color:#9900CC;">new</span>
agent.<span style="color:#9900CC;">user_agent_alias</span> = <span style="color:#996600;">'Mac Safari'</span>
&nbsp;
Before <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#0066ff; font-weight:bold;">@agent</span> = agent
  <span style="color:#0066ff; font-weight:bold;">@page</span> = <span style="color:#0000FF; font-weight:bold;">nil</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Create file search_step.rb in step_definitions directory:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># These step definitions are far from being ready for common usage</span>
<span style="color:#008000; font-style:italic;"># not depending on the site or page. It's just an example :)</span>
<span style="color:#008000; font-style:italic;"># Parsing arguments with regexp</span>
Given <span style="color:#996600;">'I am on the &quot;(.*)&quot; page'</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>page<span style="color:#006600; font-weight:bold;">|</span>
  <span style="color:#008000; font-style:italic;"># browser goto</span>
  <span style="color:#0066ff; font-weight:bold;">@page</span> = <span style="color:#0066ff; font-weight:bold;">@agent</span>.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>page<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Google case</span>
  <span style="color:#9966CC; font-weight:bold;">When</span> <span style="color:#006600; font-weight:bold;">/</span>I search <span style="color:#9966CC; font-weight:bold;">for</span> <span style="color:#996600;">&quot;(.*)&quot;</span> <span style="color:#9966CC; font-weight:bold;">in</span> form with name <span style="color:#996600;">&quot;(.*)&quot;</span><span style="color:#006600; font-weight:bold;">/</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>query, form_name<span style="color:#006600; font-weight:bold;">|</span>
  <span style="color:#008000; font-style:italic;"># search</span>
  <span style="color:#0066ff; font-weight:bold;">@page</span> = <span style="color:#0066ff; font-weight:bold;">@page</span>.<span style="color:#9900CC;">form_with</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:name</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> form_name<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>search<span style="color:#006600; font-weight:bold;">|</span>
    search.<span style="color:#9900CC;">q</span> = query
  <span style="color:#9966CC; font-weight:bold;">end</span>.<span style="color:#9900CC;">submit</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Drupal forms have no name</span>
<span style="color:#9966CC; font-weight:bold;">When</span> <span style="color:#006600; font-weight:bold;">/</span>I search <span style="color:#9966CC; font-weight:bold;">for</span> <span style="color:#996600;">&quot;(.*)&quot;</span> <span style="color:#9966CC; font-weight:bold;">in</span> form with method <span style="color:#996600;">&quot;POST&quot;</span> <span style="color:#9966CC; font-weight:bold;">and</span> action <span style="color:#996600;">&quot;(.*)&quot;</span><span style="color:#006600; font-weight:bold;">/</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>query, form_action<span style="color:#006600; font-weight:bold;">|</span>
  <span style="color:#008000; font-style:italic;"># search</span>
  <span style="color:#0066ff; font-weight:bold;">@page</span> = <span style="color:#0066ff; font-weight:bold;">@page</span>.<span style="color:#9900CC;">form_with</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:method</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;POST&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:action</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> form_action<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>search<span style="color:#006600; font-weight:bold;">|</span>
    search.<span style="color:#9900CC;">field_with</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:name</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'search_theme_form'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">value</span> = query
  <span style="color:#9966CC; font-weight:bold;">end</span>.<span style="color:#9900CC;">submit</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">Then</span> <span style="color:#006600; font-weight:bold;">/</span>I should see a link to <span style="color:#996600;">&quot;(.*)&quot;</span>:<span style="color:#006600; font-weight:bold;">&#40;</span>.<span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">/</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>text, url<span style="color:#006600; font-weight:bold;">|</span>
  link = <span style="color:#0066ff; font-weight:bold;">@page</span>.<span style="color:#9900CC;">link_with</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> text<span style="color:#006600; font-weight:bold;">&#41;</span>
  link.<span style="color:#9900CC;">text</span> == text <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> link.<span style="color:#9900CC;">href</span> == url
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Lets run rake again and see what we will get:<br />
<a href="http://blog.adyax.com/wp-content/uploads/2009/03/cucumber2.jpeg" ><img class="aligncenter size-full wp-image-195" title="rake features with defined steps" src="http://blog.adyax.com/wp-content/uploads/2009/03/cucumber2.jpeg" alt="rake features with defined steps" width="590" height="261" /></a></p>
<p style="text-align: left;">Some more screenshots:</p>
<div id="attachment_196" class="wp-caption aligncenter" style="width: 600px"><a href="http://blog.adyax.com/wp-content/uploads/2009/03/cucumber3.jpeg" ><img class="size-full wp-image-196" title="Scenario with misspelled argument" src="http://blog.adyax.com/wp-content/uploads/2009/03/cucumber3.jpeg" alt="Scenario with misspelled argument" width="590" height="261" /></a><p class="wp-caption-text">Scenario with misspelled argument</p></div>
<div id="attachment_197" class="wp-caption aligncenter" style="width: 600px"><a href="http://blog.adyax.com/wp-content/uploads/2009/03/cucumber4.jpeg" ><img class="size-full wp-image-197" title="Misspelled argument" src="http://blog.adyax.com/wp-content/uploads/2009/03/cucumber4.jpeg" alt="Misspelled argument" width="590" height="261" /></a><p class="wp-caption-text">Misspelled argument</p></div>
<p>Of course, our step definitions are far from being common and site-independent but anyhow it wasn&#8217;t a goal of this article. Cucumber is a new approach in Ruby BDD which allows to describe behavior of the model with plain-text documents.</p>
<p>To find more examples and documentation visit <a href="http://wiki.github.com/aslakhellesoy/cucumber" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://wiki.github.com/aslakhellesoy/cucumber');" target="_blank">home page of Cucumber,</a> also check out <a href="http://www.redmine.org/wiki/redmine/PluginStuffToDo" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.redmine.org/wiki/redmine/PluginStuffToDo');" target="_blank">Redmine plugin StuffToDo</a> which is a nice real-world example of Cucumber usage.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adyax.com/2009/03/ruby-cucumber/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Formation Drupal : Adyax lance une offre adaptée à chaque profil</title>
		<link>http://blog.adyax.com/2009/03/formation-drupal-adyax-lance-une-offre-adaptee-a-chaque-profil/</link>
		<comments>http://blog.adyax.com/2009/03/formation-drupal-adyax-lance-une-offre-adaptee-a-chaque-profil/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 11:18:03 +0000</pubDate>
		<dc:creator>Alexandre Israël</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://blog.adyax.com/?p=178</guid>
		<description><![CDATA[Afin de répondre aux attentes de nos clients, Adyax lance une offre complète de formation sur Drupal dont les priorités sont les mêmes que pour la réalisation de nos projets.]]></description>
			<content:encoded><![CDATA[<p>Afin de répondre aux attentes de nos clients, Adyax lance une <a href="http://www.adyax.com/fr/formation-drupal" >offre complète de formation sur Drupal</a> dont les priorités sont les mêmes que pour la réalisation de nos projets :</p>
<ul>
<li>Expertise des formateurs</li>
<li>Priorité donnée à la qualité de la prestation dans sa globalité</li>
<li>Adaptation aux objectifs opérationnels du client</li>
<li>Prise en compte des utilisations concrètes attendues</li>
</ul>
<p>N&#8217;hésitez pas à <a href="http://www.adyax.com/fr/contactez-nous" >prendre contact</a> avec nous pour en savoir plus.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adyax.com/2009/03/formation-drupal-adyax-lance-une-offre-adaptee-a-chaque-profil/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[English] Drupal Tutorial: Node Auto Term, Taxonomy tips and Jquery menu API in use.</title>
		<link>http://blog.adyax.com/2009/03/english-drupal-tutorial-node-auto-term-taxonomy-tips-and-jquery-menu-api-in-use/</link>
		<comments>http://blog.adyax.com/2009/03/english-drupal-tutorial-node-auto-term-taxonomy-tips-and-jquery-menu-api-in-use/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 14:42:51 +0000</pubDate>
		<dc:creator>Aleksey Khodakovskiy</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<category><![CDATA[Etude de cas]]></category>

		<category><![CDATA[Posts in English]]></category>

		<category><![CDATA[API]]></category>

		<category><![CDATA[control term]]></category>

		<category><![CDATA[Jquery menu]]></category>

		<category><![CDATA[Node Auto Term]]></category>

		<category><![CDATA[rewrite term path]]></category>

		<category><![CDATA[taaxonomy landing page]]></category>

		<category><![CDATA[Taxonomy]]></category>

		<category><![CDATA[taxonomy block]]></category>

		<category><![CDATA[tips]]></category>

		<category><![CDATA[tricks]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[vocabulary]]></category>

		<guid isPermaLink="false">http://blog.adyax.com/?p=160</guid>
		<description><![CDATA[Taxonomy Term description is more then just text? Taxonomy Term page is more then node listings? Is it possible? Of course, using Node Auto Term and some Drupal tricks will make your idea come true.

I like to start from example where feature can be implemented, so let&#8217;s imagine you are building website for book store [...]]]></description>
			<content:encoded><![CDATA[<p>Taxonomy Term description is more then just text? Taxonomy Term page is more then node listings? Is it possible? Of course, using Node Auto Term and some <a href="http://www.adyax.com/drupal" >Drupal</a> tricks will make your idea come true.<br />
<span id="more-160"></span><br />
I like to start from example where feature can be implemented, so let&#8217;s imagine you are building website for book store and you are interested in keeping hierarchy of genres, where books can be marked with this or that genre, but in the same time you want some of the genres contain more information associated with it, not only title and description, landing genre page be more or less representative - with kind of summaries, latest comments on books in this genre, etc.</p>
<p>Ok, why not? <a href="http://www.adyax.com/drupal" >Drupal</a> is always helping you <img src='http://blog.adyax.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
At the beginning we need to install <a id="mja4" title="Node Auto Term [NAT]" href="http://drupal.org/project/nat" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://drupal.org/project/nat');" target="_blank">Node Auto Term [NAT]</a> and enable Taxonomy core module. The NAT module is used to maintain node-term relationships, i.e. when a node is created, an equivalent taxonomy term is automatically created in any associated vocabularies. And as far as nodes can be extended with <a id="wnab" title="CCK" href="http://drupal.org/project/cck" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://drupal.org/project/cck');" target="_blank">CCK</a> fields - NAT is exactly what we need.</p>
<p>Let&#8217;s use new content types &#8216;Literary genre&#8217; (genre) and &#8216;Store book&#8217; (store_book) and new Taxonomy Vocabulary &#8216;Literary genres&#8217;, marked to tag this 2 content types. Next, go to NAT configuration - usually it can be found on this location: admin/settings/nat/settings.<br />
Open field set for &#8216;Literary genre&#8217; and select &#8216;Literary genres&#8217; as a vocabulary which will contain node related term. Here you can configure 4 extra options - for our case I found important to enable &#8216;Associate node body with term description&#8217; to be consistent in our task and keep same description for node and term. As far as Literary genres can be added manually in vocabulary as a terms (means that this genre doesn&#8217;t have any extra information and term page will contain only list of books belong to this genre) - &#8216;Delete associated term if a node is deleted&#8217; was not enabled, so if you delete NAT node - term will be still available.</p>
<p><img src="http://blog.adyax.com/wp-content/uploads/2009/03/d181d0bdd0b8d0bcd0bed0ba-d18dd0bad180d0b0d0bdd0b0-2.png" alt="step1: Configure NAT" title="step1: Configure NAT" width="610" height="540" class="size-full wp-image-162" /></p>
<p>Lets add some genre nodes</p>
<p><img src="http://blog.adyax.com/wp-content/uploads/2009/03/d181d0bdd0b8d0bcd0bed0ba-d18dd0bad180d0b0d0bdd0b0-4.png" alt="step2: Create top-level genre node" title="step2: Create top-level genre node" width="612" height="519" class="aligncenter size-full wp-image-164" /></p>
<p>Note: if you want to create a term not in the top of the hierarchy, but as a sub-genre you can do it easily: while creating new genre node - select term which you want to be parent for your new genre</p>
<p><img src="http://blog.adyax.com/wp-content/uploads/2009/03/d181d0bdd0b8d0bcd0bed0ba-d18dd0bad180d0b0d0bdd0b0-5.png" alt="step3: Add child-genre node" title="step3a: Add child-genre node" width="611" height="532" class="aligncenter size-full wp-image-165" /></p>
<p>or manually with sortable option on Taxonomy terms list page</p>
<p><img src="http://blog.adyax.com/wp-content/uploads/2009/03/d181d0bdd0b8d0bcd0bed0ba-d18dd0bad180d0b0d0bdd0b0-6.png" alt="step 3b: Manually configure hierarhy of genres." title="step 3b: Manually configure hierarhy of genres." width="611" height="536" class="aligncenter size-full wp-image-167" /></p>
<p>While filling store catalogue with books you will mark them with proper literary genre. Usually people use block to display taxonomy hierarchy (block can be displayed in different regions of your website), that&#8217;s why I researched a bit and found a nice module that provides us with opportunity to create extremely customizable blocks for browsing through single hierarchy taxonomies based on JQuery Menu API - <a id="yi68" title="Advanced Taxonomy Blocks" href="http://drupal.org/project/taxonomyblocks" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://drupal.org/project/taxonomyblocks');" target="_blank">Advanced Taxonomy Blocks</a>. I would not write a lot about configuration of this module, because you can find a helpful tutorial <a id="sqow" title="here" href="http://www.pixelclever.com/documentation-advanced-taxonomy-blocks-module-drupal-6" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.pixelclever.com/documentation-advanced-taxonomy-blocks-module-drupal-6');" target="_blank">here</a>. So I have created new block, display in it hierarchy of &#8216;Literary genres&#8217; vocabulary and count only books that were tagged with genre.</p>
<p><img src="http://blog.adyax.com/wp-content/uploads/2009/03/d181d0bdd0b8d0bcd0bed0ba-d18dd0bad180d0b0d0bdd0b0-7.png" alt="step 4: Create block that lists taxonomy vocabulary&#039;s terms." title="step 4: Create block that lists taxonomy vocabulary&#039;s terms." width="270" height="300" class="aligncenter size-full wp-image-168" /></p>
<p>Now when you click on one of the terms in the list - you go to the list of nodes which were marked with this genre. </p>
<p><img src="http://blog.adyax.com/wp-content/uploads/2009/03/d181d0bdd0b8d0bcd0bed0ba-d18dd0bad180d0b0d0bdd0b0-101.png" alt="step 5: Review genre term page (for now its default listing)." title="step : Review genre term page (for now its default listing)." width="742" height="438" class="aligncenter size-full wp-image-176" /></p>
<p>Last issue that should be implemented is to make Advanced Taxonomy Blocks module treat &#8216;Literary genre&#8217; node page as a landing page for taxonomy term if it was specified and default &#8216;taxonomy/term/%tid%&#8217; page - if not.</p>
<p>For each taxonomy term we will verify if &#8216;Literary genre&#8217; node exists and if yes - provide node page link.<br />
Here are few tips that can help us. First of all we should know that Drupal allows us to specify which module controls specific taxonomy vocabulary (we can define that vocabulary &#8216;Literary genres&#8217; was created for the sake of &#8216;book_store&#8217; module). That&#8217;s why we should execute SQL query that will set this &#8216;hidden&#8217; option for us:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">UPDATE</span> <span style="color: #008000;">`vocabulary`</span> <span style="color: #990099; font-weight: bold;">SET</span> <span style="color: #008000;">`module`</span> <span style="color: #CC0099;">=</span> <span style="color: #008000;">'book<span style="color: #008080; font-weight: bold;">_</span>store'</span> <span style="color: #990099; font-weight: bold;">WHERE</span> vid <span style="color: #CC0099;">=</span> _vid_<span style="color: #000033;">;</span></pre></td></tr></table></div>

<p>note: _vid_ is the vocabulary id of &#8216;Literary genres&#8217;</p>
<p>The second thing to know is that if module controls taxonomy vocabulary it means that it can provide rewritten URLs for each taxonomy term in it. For this we are going to implement <a id="osoy" title="hook_term_path()" href="http://api.drupal.org/api/function/taxonomy_term_path/6" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://api.drupal.org/api/function/taxonomy_term_path/6');" target="_blank">hook_term_path()</a>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Implementation of hook_term_path()
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> book_store_term_path<span style="color: #009900;">&#40;</span><span style="color: #000088;">$term</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>module_exists<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'nat'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$nids</span> <span style="color: #339933;">=</span> nat_get_nids<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$term</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tid</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #666666; font-style: italic;">// we have strong linking between node and term</span>
    <span style="color: #666666; font-style: italic;">// so only 1 node can be associated with 1 auto term</span>
    <span style="color: #000088;">$nid</span> <span style="color: #339933;">=</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$nids</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'node/'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$nid</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'taxonomy/term/'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$term</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tid</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><img src="http://blog.adyax.com/wp-content/uploads/2009/03/d181d0bdd0b8d0bcd0bed0ba-d18dd0bad180d0b0d0bdd0b0-8.png" alt="step 6: View genre landing page." title="step : View themed genre landing page." width="735" height="408" class="aligncenter size-full wp-image-173" /></p>
<p>Oh, yes <img src='http://blog.adyax.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Now with the help of simple theming we will provide what we expect from genre landing page.</p>
<p>node-genre.tpl.php</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;node&quot;&gt;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;h2 class=&quot;title&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">print</span> <span style="color: #000088;">$node_url</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">print</span> <span style="color: #000088;">$title</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;div class=&quot;content&quot;&gt;
     <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">print</span> theme<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'image'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_image</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filepath'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_image</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_image</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'style'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'float:left;'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">print</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">content</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'#value'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
    &lt;div align=&quot;center&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">print</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SOME CUSTOM TEXT/BLOCKS/LINS/ETC.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
&nbsp;
    &lt;div align=&quot;right&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">print</span> l<span style="color: #009900;">&#40;</span>t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Books of this genre'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'taxonomy/term/'</span><span style="color: #339933;">.</span> <span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nat</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>(some of php code can be moved to appropriate theme preprocess methods, here I just wanted to show how easy things can be)</p>
<p><img src="http://blog.adyax.com/wp-content/uploads/2009/03/d181d0bdd0b8d0bcd0bed0ba-d18dd0bad180d0b0d0bdd0b0-9.png" alt="step 7: View themed landing page." title="step 5: View genre landing page." width="734" height="439" class="aligncenter size-full wp-image-171" /></p>
<p>I hope this small tutorial was helpful for you. If you have any questions please don&#8217;t hesitate to ask - i will answer them with great pleasure.</p>
<p>Modules that were used :<br />
- <span class="misspell">CCK</span> v.6.x-2.1 -  http://drupal.org/project/cck<br />
- Node Auto Term [NAT] v.6.x-1.1-beta3 - http://drupal.org/project/nat<br />
- <span class="misspell">JQuery</span> Menu v.6.x-2.3 - http://drupal.org/project/jquerymenu<br />
- Advanced Taxonomy Blocks v.6.x-1.8 - http://drupal.org/project/taxonomyblocks</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adyax.com/2009/03/english-drupal-tutorial-node-auto-term-taxonomy-tips-and-jquery-menu-api-in-use/feed/</wfw:commentRss>
		</item>
		<item>
		<title>[English] Drupal Tutorial: Auto-Tag with Token</title>
		<link>http://blog.adyax.com/2009/02/english-drupal-tutorial-auto-tag-with-token/</link>
		<comments>http://blog.adyax.com/2009/02/english-drupal-tutorial-auto-tag-with-token/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 03:29:39 +0000</pubDate>
		<dc:creator>Aleksey Khodakovskiy</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<category><![CDATA[Posts in English]]></category>

		<category><![CDATA[auto tag]]></category>

		<category><![CDATA[Taxonomy Autotagger]]></category>

		<category><![CDATA[Token]]></category>

		<guid isPermaLink="false">http://blog.adyax.com/?p=105</guid>
		<description><![CDATA[Sometimes it happens that users who are posting some content on a community site forget to tag it, its annoying, right? Lets try to build small solution for this using Token module. Let me remind you what Token is for. Mostly its task is to provide API that gives an opportunity to use placeholders in [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it happens that users who are posting some content on a community site forget to tag it, its annoying, right? Lets try to build small solution for this using <a id="dcnt" title="Token module" href="http://drupal.org/project/token" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://drupal.org/project/token');" target="_blank">Token module</a>. Let me remind you what Token is for. Mostly its task is to provide API that gives an opportunity to use placeholders in big pieces of text, that will be replaced with token value during processing, for example %<span class="misspell">nid</span> or [<span class="misspell">nid</span>] will be replaced with node identifier.<br />
So the plan is to specify list of tags that should be inserted automatically if user didn&#8217;t provide them or even add certain tags for special site needs, please note that tags would not be hard-coded, but preprocessed from the content that was inserted.</p>
<p>Okay, lets say Taxonomy and Token modules were enabled. Lets create new vocabulary called Tags and in settings mark it as Tag, &#8217;story&#8217; node type will be tagged.<br />
<img class="size-full wp-image-108" title="step 1 : Create Story form with Tags field enabled" src="http://blog.adyax.com/wp-content/uploads/2009/02/d181d0bdd0b8d0bcd0bed0ba-d18dd0bad180d0b0d0bdd0b0-16.png" alt="step #1" width="593" height="170" /></p>
<p>Next step is to create simple settings form for administrator to define what tags should be inserted for new content. To help administrator, we can display him a <a id="rkpx" title="list of all available tokens" href="http://drupal.org/node/307140#comment-1240674" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://drupal.org/node/307140#comment-1240674');" target="_blank">list of all available tokens</a> for nodes. For this we will use:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">theme<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'token_help'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$type</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>in our case $type equals &#8216;node&#8217;, so the final code for helper administration form will be:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* Menu callback for the token auto-tag settings form.
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> token_autotag_admin_settings<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000088;">$form</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'token_autotag'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'token_autotag_pattern'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'#type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;span class=&quot;misspell&quot;&gt;textfield&lt;/span&gt;'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'#title'</span> <span style="color: #339933;">=&gt;</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Autotag pattern'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'#default_value'</span> <span style="color: #339933;">=&gt;</span> variable_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'token_autotag_pattern'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'[month], [language], token-autotag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
  <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>module_exists<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'token'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$form</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'token_autotag'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'token_help'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
      <span style="color: #0000ff;">'#title'</span> <span style="color: #339933;">=&gt;</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Replacement patterns'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'#type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;span class=&quot;misspell&quot;&gt;fieldset&lt;/span&gt;'</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'#collapsible'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000000; font-weight: bold;">TRUE</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'#collapsed'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000000; font-weight: bold;">TRUE</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'#description'</span> <span style="color: #339933;">=&gt;</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Prefer raw-text replacements for text to avoid problems with HTML entities!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$form</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'token_autotag'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'token_help'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'help'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
       <span style="color: #0000ff;">'#value'</span> <span style="color: #339933;">=&gt;</span> theme<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'token_help'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'node'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">return</span> system_settings_form<span style="color: #009900;">&#40;</span><span style="color: #000088;">$form</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><img class="size-full wp-image-109" title="step 2: Token auto-tag configuration form " src="http://blog.adyax.com/wp-content/uploads/2009/02/d181d0bdd0b8d0bcd0bed0ba-d18dd0bad180d0b0d0bdd0b0-18.png" alt="step 2: Token auto-tag configuration form " width="588" height="340" /></p>
<p>Default value for tagging was set to: current month, language of the post and &#8216;token-autotag&#8217;, later we will define more &#8216;clever&#8217; tags, because at the moment we don&#8217;t know how to provide them <img src='http://blog.adyax.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
So we should check user input in Tags field and if it is empty - fill it with predefined pattern, for this we are going to implement hook_<span class="misspell">nodeapi</span>() and</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">token_replace<span style="color: #009900;">&#40;</span><span style="color: #000088;">$original</span><span style="color: #339933;">,</span> <span style="color: #000088;">$type</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'global'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$object</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$leading</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'['</span><span style="color: #339933;">,</span> <span style="color: #000088;">$trailing</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">']'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* Implementation of hook_&lt;span class=&quot;misspell&quot;&gt;nodeapi&lt;/span&gt;().
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> token_autotag_nodeapi<span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">,</span> <span style="color: #000088;">$op</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$op</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'presave'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>module_exists<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'token'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>taxonomy<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'tags'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">taxonomy</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'tags'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> token_replace<span style="color: #009900;">&#40;</span>variable_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'token_autotag_pattern'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'[month], [language], token-autotag'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'node'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$node</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><img class="size-full wp-image-110" title="step 3: Review first results of token auto-tagging" src="http://blog.adyax.com/wp-content/uploads/2009/02/d181d0bdd0b8d0bcd0bed0ba-d18dd0bad180d0b0d0bdd0b0-19.png" alt="step 3: Review first results of token auto-tagging" width="591" height="260" /></p>
<p>It was easy. What&#8217;s next? Lets provide few new tokens that will be used for tagging content.<br />
We will implement Token API hooks:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">hook_token_list<span style="color: #009900;">&#40;</span><span style="color: #000088;">$type</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'all'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This function is used to provide help and in-line documentation for all of the possible replacement tokens.<br />
Note: $type indicates the context that token help is being generated for, so you should show ALL tokens at the same time if $type is &#8216;all&#8217;. As such, the help text should be keyed by the $type context your module will use when doing the actual replacements.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">hook_token_values<span style="color: #009900;">&#40;</span><span style="color: #000088;">$type</span><span style="color: #339933;">,</span> <span style="color: #000088;">$object</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This function should return a keyed array of placeholders, and their replacement values.<br />
$type contains the current context &#8212; &#8216;node&#8217;, &#8216;user&#8217;, &#8216;global&#8217;, etc.<br />
$object contains the specific node, user, etc. that should be used as the basis for the replacements.</p>
<p>For example, we are interested in :<br />
1) what part of the day post was created<br />
- 06:00 - 12:00 : &#8216;morning&#8217;;<br />
- 12:00 - 20:00 : &#8216;day&#8217;;<br />
- 20:00 - 24:00 : &#8216;evening&#8217;;<br />
- 24:00 - 06:00 : &#8216;night&#8217;.</p>
<p>2) size of the post:<br />
- less then 100 words : &#8216;note&#8217;;<br />
- 100 - 1000 words : &#8216;article&#8217;;<br />
- more then 1000 words : &#8216;narrative&#8217;.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* Implementation of hook_token_list().
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> token_autotag_token_list<span style="color: #009900;">&#40;</span><span style="color: #000088;">$type</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'all'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'node'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'all'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$tokens</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'node'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'day-part'</span><span style="color: #009900;">&#93;</span>            <span style="color: #339933;">=</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Part of the day, when post was created ('morning', 'day', 'everning', 'night')&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$tokens</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'node'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'post-size-type'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Node type based on size ('note', 'article', 'narrative')&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$tokens</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>2 new tokens - [day-part] and [post-size-type] appeared in the placeholder tokens list, so we update configuration pattern</p>
<p><img class="size-full wp-image-111" title="step 4: Add new developed tokens to the pattern" src="http://blog.adyax.com/wp-content/uploads/2009/02/d181d0bdd0b8d0bcd0bed0ba-d18dd0bad180d0b0d0bdd0b0-20.png" alt="step 4: Add new developed tokens to the pattern" width="595" height="196" /></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* Implementation of hook_token_values().
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> token_autotag_token_values<span style="color: #009900;">&#40;</span><span style="color: #000088;">$type</span><span style="color: #339933;">,</span> <span style="color: #000088;">$object</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$values</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$type</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'node'</span><span style="color: #339933;">:</span>
      <span style="color: #000088;">$hour</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'H'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'day-part'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$hour</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">6</span> ? <span style="color: #0000ff;">'night'</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$hour</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">12</span> ? <span style="color: #0000ff;">'morning'</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$hour</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">20</span> ? <span style="color: #0000ff;">'day'</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$hour</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">24</span> ? <span style="color: #0000ff;">'everning'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">'night'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #666666; font-style: italic;">// _token_autotag_get_post_words_amount - method that counts amount of numbers based on some logic</span>
      <span style="color: #000088;">$words_amount</span> <span style="color: #339933;">=</span> _token_autotag_get_post_words_amount<span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'post-size-type'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$words_amount</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">100</span> ? <span style="color: #0000ff;">'note'</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$words_amount</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">1000</span> ? <span style="color: #0000ff;">'article'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">'narrative'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$values</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><img class="size-full wp-image-112" title="step 5: Content was auto-tagged with provided tokens" src="http://blog.adyax.com/wp-content/uploads/2009/02/d181d0bdd0b8d0bcd0bed0ba-d18dd0bad180d0b0d0bdd0b0-21.png" alt="step 5: Content was auto-tagged with provided tokens" width="593" height="340" /></p>
<p>That&#8217;s it! Now you can play with it and provide some new features like give a user opportunity to put placeholders into tag field, specify tag tokens which will mark all nodes even if user inputed few, etc.<br />
If you need real relevant auto-tag utility you can take a look on <a id="h-hu" title="Taxonomy Autotagger" href="http://drupal.org/project/autotag" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://drupal.org/project/autotag');" target="_blank">Taxonomy <span class="misspell">Autotagger</span></a> which can automatically tag a node with terms from a vocabulary that the node&#8217;s content type is associated with if the terms (or the terms&#8217; synonyms) are found in the content of the node itself. And by the way, now you can build placeholder token that will call Taxonomy Autotagger methods to generate tags and put it in Tag field with your predefined tokens <img src='http://blog.adyax.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adyax.com/2009/02/english-drupal-tutorial-auto-tag-with-token/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
