Articles Anywhere

IN or NOT IN use not work

5 months 1 week ago #89098

Francisco Valenzuela's Avatar Francisco Valenzuela

Hi, I'm trying this:

<?php $titulin = $this->item->title; ?> 

    {articulos type="k2" category="3" ordering="random"}
      {if <?php echo $titulin; ?>  IN extra-8}
      
         // my code   
     
       {/if}
      {/articulos}

It is made in the item.php file of a template.

if I use: NOT IN, it shows all the articles, but if I use IN it does not show any, and I am sure that the chain is present.

extra field 8, is a selectable multiple field, and is displayed correctly, showing selected separated by commas.

example:

Can you help me on this?

5 months 1 week ago #89099

Peter van Westen's Avatar Peter van Westen Admin

The value part should be in quotes. So try:

{if '<?php echo $titulin; ?>'  IN extra-8}

5 months 1 week ago #89100

Francisco Valenzuela's Avatar Francisco Valenzuela

thanks, work 👍