Skip to content Skip to sidebar Skip to footer

If Query For Tags In Spip

It is possible to create an IF query for the tag in SPIP? When i have only one article linked to the tag than he take me directly to the article. But if i have more than 1 article,

Solution 1:

Try this, will work with any SPIP version.

    <BOUCLE_mot(MOTS){id_groupe ?}>
[(#REM) Link to mot]  
        <BOUCLE_check(ARTICLES) {id_mot} {1,1}>
            <li><ahref="#_mot:URL_MOT">#_mot:TITRE</a></li>
            [(#ID_ARTICLE|oui)]
        </BOUCLE_check>
[(#REM) Link to one article]
            <BOUCLE_one(ARTICLES) {id_mot} {0,1}>
                <li><ahref="#URL_ARTICLE">#_mot:TITRE</a></li>
            </BOUCLE_one>               
        <//BOUCLE_check>
    </BOUCLE_mot>

Solution 2:

Conditional display is a real lack in SPIP. This is what I would do (don't have any SPIP environment with me to check).

<divid="tagsphere-#ENV{id_article}"><ul>
        <BOUCLE_mot(MOTS){id_groupe ?}>

            <BOUCLE_articles(ARTICLES){id_mot = #ID_MOT}>
                <B_article_unique><li>
                    <a<BOUCLE_article_unique(ARTICLES){id_article}{si #TOTAL_BOUCLE|==1}> href="#URL_ARTICLE"</BOUCLE_article_multiple>>
                        #TITRE
                    </a></li></B_article_unique>

                <BOUCLE_article_multiple(ARTICLES){id_article}{si #TOTAL_BOUCLE|!=1} />
                <li><ahref="#URL_MOT">
                        #TITRE
                    </a></li></B_article_muliple></BOUCLE_articles></BOUCLE_mot></ul></div>

Post a Comment for "If Query For Tags In Spip"