Question about the jQuery..?

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
Wayne2224
New Member
New Member
Posts: 2
Joined: Fri Sep 25, 2009 5:24 am

Question about the jQuery..?

Post by Wayne2224 »

Hey everyone just got CMS Made Simple and i love it so far! The only problem im having is i would like to add into the teamplte some of the jQuery items i have. But im getting errors and the one thing im using a imagerotator is not working....? The code is below.

Code: Select all

<__script__ type="text/javascript">var _siteRoot='index.php',_root='index.php';</__script>
<__script__ type="text/javascript" src="js/jquery.js"></__script>
<__script__ type="text/javascript" src="js/scripts.js"></__script>
<__script__ src="js/slide.js" type="text/javascript"></__script>

  	<!-- PNG FIX for IE6 -->
  	<!-- http://24ways.org/2007/supersleight-transparent-png-in-ie6 -->
	<!--[if lte IE 6]>
		<__script__ type="text/javascript" src="js/pngfix/supersleight-min.js"></__script>
	<![endif]-->
	<!--[if IE]>
	<link type="text/css" media="screen" rel="stylesheet" href="colorbox-ie.css" title="example" />
	<![endif]-->
<__script__ type="text/javascript" src="js/jquery.min.js"></__script>
<__script__ type="text/javascript" src="js/jquery.colorbox.js"></__script>
<__script__ type="text/javascript">
			$(document).ready(function(){
				//Examples of how to assign the ColorBox event to elements
				$("a[rel='example1']").colorbox();
				$("a[rel='example2']").colorbox({transition:"fade"});
				$("a[rel='example3']").colorbox({transition:"none", width:"75%", height:"75%"});
				$("a[rel='example4']").colorbox({slideshow:true});
				$(".single").colorbox({}, function(){
					alert('Howdy, this is an example callback.');
				});
				$(".colorbox").colorbox();
				$(".youtube").colorbox({iframe:true, width:650, height:550});
				$(".iframe").colorbox({width:"80%", height:"80%", iframe:true});
				$(".inline").colorbox({width:"50%", inline:true, href:"#inline_example1"});
				
				//Example of preserving a JavaScript event for inline calls.
				$("#click").click(function(){ 
					$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
					return false;
				});
			});
</__script>
Here is the other part withing the template....

Code: Select all

  <!--960px topnav-->
  <div id="topseperator"></div>
  <div id="header"><div class="wrap">
   <div id="slide-holder">
<div id="slide-runner">
    <a href=""><img src="images/slider/image_1.png" alt="" border="0" class="slide" id="slide-img-1" /></a>
    <a href=""><img src="images/slider/image_2.png" alt="" border="0" class="slide" id="slide-img-2" /></a>
    <a href=""><img src="images/slider/image_3.png" alt="" border="0" class="slide" id="slide-img-3" /></a>
    <a href=""><img src="images/slider/image_1.png" alt="" border="0" class="slide" id="slide-img-4" /></a>
    <a href=""><img src="images/slider/image_1.png" alt="" border="0" class="slide" id="slide-img-5" /></a>
    <a href=""><img src="images/slider/image_1.png" alt="" border="0" class="slide" id="slide-img-6" /></a>
	<a href=""><img src="images/slider/image_1.png" alt="" border="0" class="slide" id="slide-img-7" /></a> 
    <a href=""><img src="images/slider/image_1.png" alt="" border="0" class="slide" id="slide-img-8" /></a>
    <a href=""><img src="images/slider/image_1.png" alt="" border="0" class="slide" id="slide-img-9" /></a>
	<a href=""><img src="images/slider/image_1.png" alt="" border="0" class="slide" id="slide-img-10" /></a> 
    <div id="slide-controls">
     <p id="slide-client" class="text"><strong>Post: </strong><span></span></p>
     <p id="slide-desc" class="text"></p>
     <p id="slide-nav"></p>
    </div></div>
	<!--content featured gallery here -->
   </div>
   <__script__ type="text/javascript">
    if(!window.slider) var slider={};slider.data=[{"id":"slide-img-1","client":"Ober Terrain Parks","desc":"Something new is coming..."},{"id":"slide-img-2","client":"Knoxville SkatePark","desc":"Where are you...?"},{"id":"slide-img-3","client":"Knoxville SkatePark","desc":""},{"id":"slide-img-4","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-5","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-6","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-7","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-8","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-9","client":"nature beauty","desc":"add your description here"},{"id":"slide-img-10","client":"nature beauty","desc":"add your description here"}];
   </__script>
  </div></div><!--/header-->
Here is the error code the pops up right above my template....

Code: Select all

string(264) "Smarty error: [in tpl_head:23 line 19]: syntax error: unrecognized tag: //Examples of how to assign the ColorBox event to elements $("a[rel='example1']").colorbox(); $("a[rel='example2']").colorbox({transition:"fade" (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_head:23 line 19]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(154) "Smarty error: [in tpl_head:23 line 22]: syntax error: unrecognized tag: transition:"none", width:"75%", height:"75%" (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_head:23 line 22]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(124) "Smarty error: [in tpl_head:23 line 23]: syntax error: unrecognized tag: slideshow:true (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_head:23 line 23]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(110) "Smarty error: [in tpl_head:23 line 24]: syntax error: unrecognized tag: (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_head:23 line 24]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(155) "Smarty error: [in tpl_head:23 line 24]: syntax error: unrecognized tag: alert('Howdy, this is an example callback.'); (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_head:23 line 24]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(144) "Smarty error: [in tpl_head:23 line 26]: syntax error: unrecognized tag: iframe:true, width:650, height:550 (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_head:23 line 26]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(148) "Smarty error: [in tpl_head:23 line 27]: syntax error: unrecognized tag: width:"80%", height:"80%", iframe:true (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_head:23 line 27]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(159) "Smarty error: [in tpl_head:23 line 28]: syntax error: unrecognized tag: width:"50%", inline:true, href:"#inline_example1" (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_head:23 line 28]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(188) "Smarty error: [in tpl_head:23 line 31]: syntax error: unrecognized tag: $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit" (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_head:23 line 31]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(110) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag: (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(194) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag: "id":"slide-img-1","client":"Ober Terrain Parks","desc":"Something new is coming..." (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(186) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag: "id":"slide-img-2","client":"Knoxville SkatePark","desc":"Where are you...?" (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(169) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag: "id":"slide-img-3","client":"Knoxville SkatePark","desc":"" (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(188) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag: "id":"slide-img-4","client":"nature beauty","desc":"add your description here" (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(188) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag: "id":"slide-img-5","client":"nature beauty","desc":"add your description here" (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(188) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag: "id":"slide-img-6","client":"nature beauty","desc":"add your description here" (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(188) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag: "id":"slide-img-7","client":"nature beauty","desc":"add your description here" (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(188) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag: "id":"slide-img-8","client":"nature beauty","desc":"add your description here" (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(188) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag: "id":"slide-img-9","client":"nature beauty","desc":"add your description here" (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(189) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag: "id":"slide-img-10","client":"nature beauty","desc":"add your description here" (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_body:23 line 99]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
Now i know this deals with the script that is not in its own js file. On top of this i have download and installed the jQuery module....? And i have even included like it says the 2 parts into the template.
Both {JQueryTools action=incjs} and {JQueryTools action=ready}

Also when im wanting to add my stylesheets to the site its not working when i add them with CMS Made Simple i still have to include the full link to the sytlesheet in order for it to work right..?? Andy Ideas, thanks in advance for the help!
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm
Location: MI

Re: Question about the jQuery..?

Post by Jeff »

Did you remember to put the {literal}{/literal} tags around all your js code?
Wayne2224
New Member
New Member
Posts: 2
Joined: Fri Sep 25, 2009 5:24 am

Re: Question about the jQuery..?

Post by Wayne2224 »

Yeah i just tried the {literal}{/literal} tags and i got the same outcome. I know that the colourbox was working for a little while but its not now...

EDIT!
Ill take that back i now see where i went wrong, i thought you ment put the {literal}{/literal} tags around the actually script tags. Instead it should look like so below.

Code: Select all

<__script__ type="text/JavaScript">
		   {literal}$(document).ready(function(){
				//Examples of how to assign the ColorBox event to elements
				$("a[rel='example1']").colorbox();
				$("a[rel='example2']").colorbox({transition:"fade"});
				$("a[rel='example3']").colorbox({transition:"none", width:"75%", height:"75%"});
				$("a[rel='example4']").colorbox({slideshow:true});
				$(".single").colorbox({}, function(){
					alert('Howdy, this is an example callback.');
				});
				$(".colorbox").colorbox();
				$(".youtube").colorbox({iframe:true, width:650, height:550});
				$(".iframe").colorbox({width:"80%", height:"80%", iframe:true});
				$(".inline").colorbox({width:"50%", inline:true, href:"#inline_example1"});
				
				//Example of preserving a JavaScript event for inline calls.
				$("#click").click(function(){ 
					$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
					return false;
				});
			});{/literal}
</__script>
Working great now thanks for that little tip!!
Last edited by Wayne2224 on Fri Sep 25, 2009 3:06 pm, edited 1 time in total.
Post Reply

Return to “Layout and Design (CSS & HTML)”