Articles Anywhere

Specific article id always last in list

4 months 2 weeks ago #89500

Laurent's Avatar Laurent

Hello,

With this code i display 4 article from a category

<div class="grid-actus">
    {articles category="8" limit="4"}
         <div class="grid-actus-item">
             [image-actu]
	     <h3>[title]</h3>
	     [introtext]
             [date-actu]
       </div>
    {/articles}
</div>

Is there a way to display a specific article always in last or first position even if there is new articles create ?

Thanks.

4 months 2 weeks ago #89507

Peter van Westen's Avatar Peter van Westen Admin

No, you would have to split it up into 2 tags, like:

<div class="grid-actus">
    {articles category="8" limit="3" article="!123"}
         <div class="grid-actus-item">
             [image-actu]
	     <h3>[title]</h3>
	     [introtext]
             [date-actu]
       </div>
    {/articles}
    {article article="123"}
         <div class="grid-actus-item">
             [image-actu]
	     <h3>[title]</h3>
	     [introtext]
             [date-actu]
       </div>
    {/article}
</div>
(Replace the 123 with your desired article id)

4 months 2 weeks ago #89508

Laurent's Avatar Laurent

OK thanks, i just try this is perfect 🙂 👍 .