Posts: 24
Threads: 4
Joined: Feb 2012
2013-03-05, 21:50:04
(This post was last modified: 2013-03-05, 21:50:26 by Superbobo.)
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
Posts: 24
Threads: 4
Joined: Feb 2012
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
Posts: 24
Threads: 4
Joined: Feb 2012
2013-03-06, 20:09:10
(This post was last modified: 2013-03-06, 20:09:34 by Superbobo.)
hi, if it ever helped anyone, so here is my functional outcome beginner PHP programming

:
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>";}
}
}
?>
Posts: 6,266
Threads: 181
Joined: Sep 2011
Should be able to do the same without i18_n by looping over the pagesarray exploding the meta fields and checking for the tag.