SPIP-Contrib

SPIP-Contrib

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

289 Plugins, 197 contribs sur SPIP-Zone, 74 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?
  • [Connettersi]

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) ORR v2

    21 mai 2013 – 105 commentaires

    ORR, le plugin d’Organisation des Réservations et des Ressources passe en version 2, avec quelques nouveautés attendues. Je ne reprendrai pas les explications données dans la version 1. Les nouveautés : 1. Gestion des autorisations Le principe (...)

  • (fr) Speedsyndic pour SPIP 2 et SPIP 3

    11 octobre 2010 – 32 commentaires

    Ce plugin est une version compatible spip 2.0.x / 2.1 / 3.1 du plugin Speedsyndic Note : Une bonne partie du texte ci-dessous a été pompé de cet article, expliquant la version précédente du plugin. je n’ai fait qu’adapter le code pour spip 2, ajouter (...)

  • (fr) Personnalisation graphique du squelette SoyezCréateurs

    19 août 2009 – 110 commentaires

    Il est possible de personnaliser l’affichage du squelette SoyezCréateurs de manière plus ou moins profonde. Changement dans les couleurs via CFG La page de CFG des couleurs de SoyezCreateurs : ecrire/ ?exec=cfg&cfg=soyezcreateurs_couleurs (...)

  • (fr) Visualiser un PDF dans un article

    13 juin – commentaires

    SoyezCréateurs utilise un modèle pour afficher un PDF dans e corps d’un article Un peu d’histoire Avant, les navigateurs n’incluaient pas de lecteur PDF nativement ce qui avait conduit à la création du plugin Lecteur pdf javascript pdf.js. Mais, (...)