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.

General Questions /

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

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

scripts in page_controller init


Reply


1024 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>