SPIP-Contrib

SPIP-Contrib

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

290 Plugins, 198 contribs sur SPIP-Zone, 104 visiteurs en ce moment

Home > 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]

0 vote

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>

Dernière modification de cette page le 25 gennaio 2007

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) Owl Carousel 2

    30 novembre 2017 – 29 commentaires

    Owl Carousel est un diaporama jQuery adaptable aux différentes tailles d’écran, qu’on peut actionner par glisser, il utilise CSS3 mais il est compatible avec les vieux navigateurs, et il est aussi paramétrable. Le présent plugin permet d’utiliser (...)

  • (fr) Configuration des traitements de Formidable

    12 mai – 13 commentaires

    Une fois le formulaire et les champs créés formidable propose de « configurer les traitements » Cet article vise à préciser ou compléter quand ça semble nécessaire certains choix présents. Le premier choix consiste à savoir si on veut : « Poster par (...)

  • (fr) Menus

    18 août 2009 – 1005 commentaires

    Créez enfin vos menus facilement !

  • (fr) PHANTOM (HTML5UP)

    18 juillet – 29 commentaires

    Squelette SPIP pour intégrer le modèle Phantom de HTML5UP. https://html5up.net/phantom Installation A l’activation, le plugin installe aussi les plugins suivants : crayons, favicon, metasplus+, Couleur d’objet, champs extras, SPIP reset centre (...)

  • (fr) À propos des plugins actifs

    13 novembre 2010 – 28 commentaires

    À propos des plugins actifs affiche dans la partie publique de votre site la version de SPIP utilisée et la liste des Plugins activés avec affichage de l’icône, le nom, la version, l’état et une introduction de sa fonction. Si le Plugin n’a pas (...)