SPIP-Contrib

SPIP-Contrib

عربي | Deutsch | English | Español | français | italiano

273 Plugins, 191 contribs sur SPIP-Zone, 35 visiteurs en ce moment

Home page > Contribs à ranger > Italiano > La caverna dei cicli > To show the same article in several different sections without (...)

To show the same article in several different sections without keywords

23 giugno 2005 – di Cap

Tutte le versioni di questo articolo: [français] [italiano] [italiano]

How to manage the presentation of the same article in different hierarchies of sections without keywords.

The issue

How would it be possible to place the same article in different sections, showing the hierarchy of each section, and the «good» path to the article ?

Simple hierarchy

With SPIP it is possible to manage different subdivisions for articles using keywords (as blogs do). However it is not possible to create tree structures for keywords and, consequently, such a solution is only suitable to a very simple subdivision, without any subcategories or subsections.

How to face it

Diego Weisz, an Italian SPIP user, proposes to manually create the various hierarchical structures of the sections and to insert the same article in most of them using the article redirection feature.

The limits

This kind of management has surely some limits:

-  the impossibility to know in which sections an article is present, and all other ones that redirect to it, in an unique page.

-  it is not possible to use the context of the virtual article, as SPIP will always take as a reference the real article. As an example, it is not possible to use the HIERARCHIE loop to show the navigation path of the virtual article in the page that shows the article itself.

The first point is not easy to solve. After all, we are asking SPIP to do something it is not supposed to do !

A last effort

About the second point, it is possible to use a simple hack. Every time a user asks for the page of an article for which a redirection exists, SPIP redirects the browser to the specified URL. This last one does not contain any reference to the source virtual article. If it were possible to redirect the browser towards an URL in which the source article id is present too, it would be possible to show the original article and, at the same time, to use the context of the virtual article.

Let’s supose we have 2 articles with id 1 and 2. This last one is a virtual one and must redirect to article 1. It is sufficient to write this URL in the redirect box:

http://mysite.com/article.php3?id_article=1&id_virt=2

The variable id_virt has been introduced and its value is the source article id.

How is it possible to use this information inside the template of our page to show the path of the article whose id is id_virt or that of the article whose id is id_Article if id_virt is not present?

Thanks to the following loop:

<!-- If id_virt exists - it selects the article with id=id_virt-->
<BOUCLE_art(ARTICLES) {id_article=#ENV{id_virt}}>
        <BOUCLE_hier(HIERARCHIE) {id_article}>
        </BOUCLE_hier>
</BOUCLE_art>
        <!-- id_virt does not exist - it selects the article with id=id_article-->
        <BOUCLE_art2(ARTICLES) {id_article}>
                <BOUCLE_hier2(HIERARCHIE) {id_article}>
                </BOUCLE_hier2>
        </BOUCLE_art2>
<//B_art>
Retour en haut de la page

Rispondere all'articolo

Chi sei?

Per mostrare qui il tuo avatar, registralo prima su gravatar.com (gratis e indolore). Non dimenticare di fornire il tuo indirizzo email.

Inserisci qui il tuo commento Les choses à faire avant de poser une question (Prolégomènes aux rapports de bugs. )
Aggiungi un documento

Retour en haut de la page

Ça discute par ici

  • (fr) Une licence pour un article

    18 avril 2007 – 25 <blink style='color:red;'>public|spip|ecrire:commentaires</blink>

    Sur une idée originale de erational, voici un plugin permettant de lier une licence à un article.

  • (fr) Plugin Parrainage

    6 novembre 2011 – <blink style='color:red;'>public|spip|ecrire:commentaire</blink>

    Permettre aux utilisateurs d’inviter leurs contacts à s’inscrire sur le site. Description Vous connaissez le web moderne et son cortège d’applis toujours en version « beta » et de buzz sur le dernier réseau à la mode ? Vous voulez vous aussi vous y (...)

  • (fr) Formulaire de contact libre

    27 avril 2011 – 36 <blink style='color:red;'>public|spip|ecrire:commentaires</blink>

    Dans SPIP il n’y a pas un formulaire de contact, mais autant de formulaires de contact que d’auteurs. Cette phrase de Romy, dans son article Une page de contact dans mon SPIP, pointe un petit manque de SPIP. La possibilité d’insérer rapidement un (...)

  • (fr) Plugin Mot de Passe Compliqué

    2 novembre 2007 – 16 <blink style='color:red;'>public|spip|ecrire:commentaires</blink>

    Ce plugin ajoute un testeur de complexité de mot de passes dans les formulaires de choix de mot de passe de SPIP.

  • (fr) Navigation AJAX

    31 janvier – 18 <blink style='color:red;'>public|spip|ecrire:commentaires</blink>

    Ce plugin permet de modifier automatiquement une parties des liens internes de manière à ce qu’ils ne déclenchent pas un chargement complet de la page cible, mais un chargement en AJAX de certains éléments spécifiés à l’avance. Il permet aussi de (...)