How to call a javascript only for specific page/template

Yep we use it on our site and love it :wink: I think it deserves to be more known though !

Use the in_array() function (https://www.php.net/manual/en/function.in-array.php):

if (in_array($page->uid(),array('this uid','that uid'))) {
  // do something
}
else {
  // do something else
}
1 Like