GetSimple Support Forum

Full Version: Condition by tag
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

i need to create a condition by tag.
If the page contains a tag such as "product" I want to show the message "hello". page of the tag may have definetly more.

Thanks
I assume that the feature uses return_i18n_tags (). I really php dummy, so the description of this function is not decipherable for me, and I have not found anywhere any example how to use it. Could someone write a condition where it checks if the page is a tag such as "product"?

Thank you in advance
hi, if it ever helped anyone, so here is my functional outcome beginner PHP programming Smile:

PHP Code:
<?php
  $slug 
return_page_slug(); 
  
$tags return_i18n_tags();
     foreach (
$tags as $tag => $urls
     {
       if (
in_array ($slug$urls)) {
            if (
$tag == "en") {echo "<strong>tag '".$tag."' was found on the page</strong>";}
        }
     }
?>
Should be able to do the same without i18_n by looping over the pagesarray exploding the meta fields and checking for the tag.