Search
Other Articles Anywhere questions
Forum

filter by tag null + else

Serge Billon's Avatar Serge Billon
hello

we need to filter out items that have the "LOCAL" tag or that have no tag and share the same "localisation" custom field.
so here is the code tried :
<div class="span12 actu_ligne"> <span class="titre_des_actus">Actualités</span><br> <div id="bloc_actu"> {articles category="actualites" include_child_categories="true" tags=""||"LOCAL" localisation="current" limit="3" ordering="publish_up DESC" empty="Pas encore d actualités"} <div class="span4 actus">  {if image-intro} [link][image-intro width="280" height="180"][/link] {elseif image-fulltext} [link][image-fulltext width="280" height="180"][/link] {else} <div class="image_vide"></div> {/if} <span class="cat_actus">[category-title]</span> <span class="cat_created">[created format="d/m/Y"]</span><br> <h3 class="titre_actus">[link][title limit="40"][/link]</h3><br> <span class="intro_actus">[introtext limit="100"]</span><br> [readmore text="Lire la suite"] </div> {/articles} </div>  </div>

find items with no tags, but not LOCAL tag
<div class="span12 actu_ligne"> <span class="titre_des_actus">Actualités</span><br> <div id="bloc_actu"> {articles category="actualites" include_child_categories="true" tags="" OR tags="LOCAL" localisation="current" limit="3" ordering="publish_up DESC" empty="Pas encore d actualités"} <div class="span4 actus">  {if image-intro} [link][image-intro width="280" height="180"][/link] {elseif image-fulltext} [link][image-fulltext width="280" height="180"][/link] {else} <div class="image_vide"></div> {/if} <span class="cat_actus">[category-title]</span> <span class="cat_created">[created format="d/m/Y"]</span><br> <h3 class="titre_actus">[link][title limit="40"][/link]</h3><br> <span class="intro_actus">[introtext limit="100"]</span><br> [readmore text="Lire la suite"] </div> {/articles} </div>  </div>

select the correct tags (empty and LOCAL) but do not take care of localisation field

have you got any idea?

site is intranet ( difficult to get it in line)

thanks
Andrea Malalana's Avatar Andrea Malalana ADMIN
It's a bit complicated because you want to combine empty tags with a specific tag, which we didn't really think about.

Try this as your articles tag:
{articles category="actualites" include_child_categories="true" tags="" localisation="current" OR category="actualites" include_child_categories="true" tags="LOCAL" localisation="current" ordering="publish_up DESC" limit="3" empty="Pas encore d actualités"}
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription