To load script only on index context


OJS 3.2.1

I used this code:

      array('baseUrl' => '')

JS script loads in frontend, but i would like that only it will load at indexJournal.

Context is frontend or backend, frontend by default, but, can i use context => index or something?


Hi @juanito,

As far as I remember, you can use something like:

$requestedPage = $this->getRequest()->getRequestedPage();
if ($requestedPage === 'index' || $requestedPage === '') {
1 Like

Thank you very much @Vitaliy .

It works!