Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

scripts in page_controller init


Go to End


1801 Views

Avatar
George

Community Member, 41 Posts

9 January 2010 at 5:22am

Hi

Scripts that are included in page.php (for example sifr) are parsed inside another scripts in the html body:

Page.ss:

<!-- Google Analytics -->
<script type="text/javascript">var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script>
<script type="text/javascript">try {var pageTracker = _gat._getTracker("UA");pageTracker._trackPageview();} catch(err) {}</script>
<!-- End Google Analytics -->

</body>
</html>

with activated sifr in Page.php:

<!-- Google Analytics -->
<script type="text/javascript">var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));</script>
<script type="text/javascript" src="http://www/sifr/javascript/sifr.js?m=1262963399"></script><script type="text/javascript">//<![CDATA[
var lt = { src: 'themes/gg/fonts/lt.swf', ratios: ''};sIFR.activate(lt);

//]]></script><script type="text/javascript">try {var pageTracker = _gat._getTracker("UA");pageTracker._trackPageview();} catch(err) {}</script>
<!-- End Google Analytics -->

</body>
</html>