Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 07-21-2015 10:29:24

geraldz
Member
Registered: 09-27-2011
Posts: 251

Load javascript on splash page

We have a custom YouTube popup on our website but the code only loads on our category pages:

if ($namespace == 'catshow') {


How can I change this to also load on our splash (home) page?

Thanks!

Offline

 

#2 07-22-2015 16:06:05

jj1987
Member
From: Orlando, FL
Registered: 07-14-2008
Posts: 502
Website

Re: Load javascript on splash page

geraldz wrote:

We have a custom YouTube popup on our website but the code only loads on our category pages:

if ($namespace == 'catshow') {


How can I change this to also load on our splash (home) page?

Thanks!

You would do

Code:

if ($namespace == 'catshow' || ($app == 'display' && $ref == 'splash')) {


-James Garrett

Offline

 

#3 07-22-2015 17:01:17

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Load javascript on splash page

I've just adjusted jj's code.  It had a syntax error in it.  Looks good now.


Nick Hendler

Offline

 

#4 07-31-2015 08:32:48

geraldz
Member
Registered: 09-27-2011
Posts: 251

Re: Load javascript on splash page

That doesn't actually work sad

Last edited by geraldz (08-04-2015 14:10:17)

Offline

 

#5 05-22-2017 07:59:31

geraldz
Member
Registered: 09-27-2011
Posts: 251

Re: Load javascript on splash page

This seems to work:

Code:

if ($this->globals('core.app') == 'cms' && $this->globals('core.namespace') == 'display' && ($this->globals('core.ref') == 'splash' || $this->globals('core.ref') == '')) {

Offline

 

#6 05-22-2017 11:48:13

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Load javascript on splash page

Very good.  I think jj was assuming you had $app and $ref already defined.


Nick Hendler

Offline

 

Board footer