Articles Anywhere

if tags structure

1 month 1 week ago #90040

Laurent's Avatar Laurent

Hello,

I have this tags structure

{articles category="10" include_child_categories="true" zone="sud-est" ordering="numero-zone ASC"}	
	{if hotel-mahourat="1"}
		<div class="zone-se__item-hotel">
			<div>22 - Hôtel d'entreprise de Mahourat :</div>
			<div>[title]</div>
		</div>
	{else}
	<div class="zone-se__item">
		[numero-zone] - [title]
	</div>
	{/if}
{/articles}
Ok it work but the output is like this :
Sud-Est
22 - Hôtel d'entreprise de Mahourat :
Auto 1
22 - Hôtel d'entreprise de Mahourat :
Agro 1
26 - Agro 1 (2)

And i need this :
Sud-Est
22 - Hôtel d'entreprise de Mahourat :
Auto 1
Agro 1
26 - Agro 1 (2)

I do something wrong on my tags !

Thanks.

1 month 1 week ago #90041

Laurent's Avatar Laurent

1 month 1 week ago #90042

Peter van Westen's Avatar Peter van Westen Admin

The output is as expected.
You are saying that - for every article returned - if the hotel-mahourat="1", then output:

22 - Hôtel d'entreprise de Mahourat :
[title]

So that will happen for "Auto 1" and "Agro 1"

1 month 1 week ago #90043

Laurent's Avatar Laurent

Yes but i need only one time the 22 - Hôtel d'entreprise de Mahourat :

1 month 1 week ago #90044

Laurent's Avatar Laurent

My solution :

{articles category="10" include_child_categories="true" zone="sud-est" hotel-mahourat="" ordering="numero-zone ASC"}	
	<div class="zone-se__item">
		[numero-zone] - [title]
	</div>
{/articles}
<div>22 - Hôtel d'entreprise de Mahourat :</div>
{articles category="10" include_child_categories="true" zone="sud-est" hotel-mahourat="1" ordering="title ASC"}	
	<div class="zone-se__item">
		[title]
	</div>
{/articles}
<div>28 - Commerces :</div>
{articles category="10" include_child_categories="true" zone="sud-est" commerces-zone-28="1" ordering="title ASC"}	
	<div class="zone-se__item">
		[title]
	</div>
{/articles}

Perhaps there is something more simple ?

1 month 1 week ago #90045

Peter van Westen's Avatar Peter van Westen Admin

Yes, that is a good solution.