OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Including javascript in header

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

Including javascript in header

Postby acmajeed » Mon Mar 11, 2013 2:42 am

Hello,
I am having some trouble getting to include external javascript in the header
After some trial and error I found that including the script in
/lib/pkp/templates/common/header.tpl

works.
However I notice that the variables are being stripped off from the including script. For eg I need to include the script below
Code: Select all
<script type="text/javascript">var notifyBarWidget = new NotifySnack();notifyBarWidget.init({hash:"ntm8ri9"});</script>


But the systems seems to strip off the
Code: Select all
 {hash:"ntm8ri9"}
bit.
Is there any way to get round this

Many thanks in advance
Ash
acmajeed
 
Posts: 2
Joined: Mon Mar 11, 2013 2:35 am

Re: Including javascript in header

Postby asmecher » Mon Mar 11, 2013 8:24 am

Hi Ash,

In Smarty templates, you'll need to escape { and } characters e.g. using {ldelim} and {rdelim} instead. See the Smarty documentation at http://smarty.net.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9214
Joined: Wed Aug 10, 2005 12:56 pm

Re: Including javascript in header

Postby acmajeed » Mon Mar 11, 2013 8:49 am

wow. Fantastic. thanks a lot !
Ash
acmajeed
 
Posts: 2
Joined: Mon Mar 11, 2013 2:35 am


Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron