Porting problem.....
Permalink<script src="<?php echo $this->getThemePath()?>/script/jquery_cycle.js" type="text/javascript"></script> <script src="<?php echo $this->getThemePath()?>/script/bubblepopup.js" type="text/javascript" ></script> <script src="<?php echo $this->getThemePath()?>/script/ui_core.js" type="text/javascript"></script> <script src="<?php echo $this->getThemePath()?>/script/ui_tabs.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { $('#placeimages').cycle({ fx: 'fade', delay: 2000, timeout: 4000 }); $('#menutabs').tabs({ fx: { opacity: 'toggle' } }); }); </script>
how would i disable the javascript only when the page is in edit mode?
thanks in advance
Parse error: parse error in C:\wamp\www\concrete\themes\web\default.php on line 21
Please post your full page code here.
But I also gave you the wrong function, thanks Scottc.
<?php if (!$this->editingEnabled()) { ?> <script src="<?php echo $this->getThemePath()?>/script/jquery_cycle.js" type="text/javascript"></script> <script src="<?php echo $this->getThemePath()?>/script/bubblepopup.js" type="text/javascript" ></script> <script src="<?php echo $this->getThemePath()?>/script/ui_core.js" type="text/javascript"></script> <script src="<?php echo $this->getThemePath()?>/script/ui_tabs.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { $('#placeimages').cycle({ fx: 'fade', delay: 2000, timeout: 4000 }); $('#menutabs').tabs({ fx: { opacity: 'toggle' } }); });
That will work for you.
<?php global $c; if (!$c->isEditMode()) { ?> <script src="<?php echo $this->getThemePath()?>/script/jquery_cycle.js" type="text/javascript"></script> <script src="<?php echo $this->getThemePath()?>/script/bubblepopup.js" type="text/javascript" ></script> <script src="<?php echo $this->getThemePath()?>/script/ui_core.js" type="text/javascript"></script> <script src="<?php echo $this->getThemePath()?>/script/ui_tabs.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { $('#placeimages').cycle({ fx: 'fade', delay: 2000, timeout: 4000 }); $('#menutabs').tabs({ fx: { opacity: 'toggle' } });
It wasn't working for me in the c5 beta version which is why I was trying to find another way to do it.
Try this for including your scripts while not in edit mode
Cheers.