[Solved] Javascipt can't load in CMS

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
realrock
Forum Members
Forum Members
Posts: 227
Joined: Tue Sep 04, 2007 8:14 pm

[Solved] Javascipt can't load in CMS

Post by realrock »

Hi,

I want to insert a flash component in my CMS, but there seems to be a problem with loading in the javascipt.

I have made a new template with the links to the javascipt file (AC_RunActiveContent.js) and of course the flash code. It work in the normal HTML code: http://intouch.stonespoint.org/flow/portfilio.html

But when I the the same in my CMS, it doesn't show up..? http://intouch.stonespoint.org/index.php?page=portfolio

I have search for this problem on the forums and one of the solutions would be to insert the {/literal} tags, but that was not the solution...

Is there someone how can help me out?.. thanks!

When I refresh I get this message:

Code: Select all

string(163) "Smarty error: [in template:23 line 51]: syntax error: unrecognized tag: alert("Deze pagina vereist AC_RunActiveContent.js."); (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in template:23 line 51]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(553) "Smarty error: [in template:23 line 51]: syntax error: unrecognized tag: AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width','773','height','270','id','example_scroll_bar','align','middle','src','example_scroll_bar','quality','high','bgcolor','#ffffff','name','example_scroll_bar','allowscriptaccess','sameDomain','allowfullscreen','false','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','example_scroll_bar' ); //end AC code (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in template:23 line 51]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
Page:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<__html>
<HEAD>
<title>{sitename} - {title}</title>
{stylesheet}
{cms_module module="statistics"} 
{literal}<__script__ language="javascript">AC_FL_RunContent = 0;</__script>{/literal}
{literal}<__script__ src="uploads/AC_RunActiveContent.js" language="javascript"></__script>{/literal}
<__script__ type='text/javascript' src='quickmenu1.js'></__script>
</HEAD>

</__body BGCOLOR="#F2F2F2" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0" > 
<TABLE WIDTH="775" BORDER="0" align="center" CELLPADDING="0" CELLSPACING="0" style="border-bottom:1px solid #CDCDCD"> 
  <TR> 
    <TD WIDTH="1" BGCOLOR="#CDCDCD"><IMG SRC="images/trans.gif" WIDTH="1" HEIGHT="1" BORDER="0"></TD> 
    <TD WIDTH="773"><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"> 
        <TR> 
            <TD HEIGHT="20" BGCOLOR="#96C03D"><div style="float: right;">{lang} </div></TD> 
        </TR> 
        <TR> 
          <TD HEIGHT="120" BGCOLOR="#3A3740"><TABLE WIDTH="773" HEIGHT="120" BORDER="0" CELLPADDING="0" CELLSPACING="0">
  <TR>
    <TD HEIGHT="50" VALIGN="top"><table border=0 cellpadding=0 cellspacing=0>
			<tr>
				<td bgcolor="#3a3740"><img src="images/trans.gif" width=41 height=36 alt=""></td>
								<td bgcolor="#3a3740">
							<a href="../index.php"><img src="images/home.png" width="51" height="26" BORDER="0"/></a><a href="../index.php?page=intouch"><img src="images/intouch.png" width="67" height="26" BORDER="0"/></a><a href="../index.php?page=diensten"><img src="images/diensten.png" width="70" height="26" BORDER="0"/></a><a href="../index.php?page=portfolio"><img src="images/portfolio.png" width="80" height="26" BORDER="0"/></a><a href="../index.php?page=contact"><img src="images/contact.png" width="69" height="26" BORDER="0"/></a>
									</td>
					</tr>
</table>
				<table border=0 cellpadding=0 cellspacing=0>
		<tr>
			<td width=41 valign="top"></td>
			<td width=53 valign="top"></td>
			<td></td>
			<td></td>
			<td></td>
			<td></td>
		</tr>
		</table>
		
		</TD>
  </TR>
  <TR>
    <TD height="70" VALIGN="bottom"><IMG SRC="images/hoofdmenu.gif" alt="InTouch Design" WIDTH="773" HEIGHT="70" BORDER="0"></TD>
  </TR>
</TABLE>
            <table width="773" height="270" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><__script__ language="javascript">
	if (AC_FL_RunContent == 0) {
		alert("Deze pagina vereist AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width','773','height','270','id','example_scroll_bar','align','middle','src','example_scroll_bar','quality','high','bgcolor','#ffffff','name','example_scroll_bar','allowscriptaccess','sameDomain','allowfullscreen','false','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','example_scroll_bar' ); //end AC code
	}
                </__script>
                  <noscript>
                  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="773" height="270" id="example_scroll_bar" align="middle">
                    <param name="allowScriptAccess" value="sameDomain" />
                    <param name="allowFullScreen" value="false" />
                    <param name="movie" value="example_scroll_bar.swf" />
                    <param name="quality" value="high" />
                    <param name="bgcolor" value="#ffffff" />
                    <embed src="example_scroll_bar.swf" quality="high" bgcolor="#ffffff" width="773" height="270" name="example_scroll_bar" align="middle" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />                  
</object>
                  </noscript></td>
              </tr>
            </table></TD> 
        </TR> 
        <!-- EERSTE DRIE KOLOMMEN --> 
        <TR> 
          <TD BGCOLOR="#FFFFFF" VALIGN="TOP"><TABLE WIDTH="773" BORDER="0" CELLPADDING="0" CELLSPACING="0"> 
              <TR> 
                <TD ROWSPAN="2" WIDTH="50"><IMG SRC="images/trans.gif" WIDTH="50" HEIGHT="5"></TD> 
                <TD ROWSPAN="2" WIDTH="439" VALIGN="TOP">
                    <TABLE WIDTH="439" BORDER="0" CELLPADDING="0" CELLSPACING="0"> 
                      <TR> 
                        <TD width="365"><img src="images/trans.gif" width="439" height="35" border="0"></TD> 
                      </TR> 
                      <TR>
                        <TD height="37" class="subtd">{cms_module module="TruetypeText" style="kop1" text="%title"}</TD>
                      </TR>
                      <TR> 
                        <TD class="subtd"><p>{content}</p>                        </TD> 
                      </TR> 
                    </TABLE>			  </TD> 
                <TD ROWSPAN="2" WIDTH="44"><IMG SRC="images/trans.gif" WIDTH="44" HEIGHT="5"></TD> 
                <TD WIDTH="205" VALIGN="TOP"><TABLE WIDTH="205" BORDER="0" CELLPADDING="0" CELLSPACING="0"> 
                    <TR> 
                      <TD BGCOLOR="#FFFFFF"><IMG SRC="images/trans.gif" WIDTH="50" HEIGHT="35"></TD> 
                    </TR> 
                    <TR> 
                      <TD COLSPAN="2"></p></TD>
                    </TR> 
                    <TR> 
                      <TD COLSPAN="2"><ul id="qm0" class="qmmc">

	<li><a class="qm-startopen qmparent" href="javascript:void(0)"><img src="images/menu_intouch.jpg" alt="InTouch" width="133" height="17" border="0"></a>

		<ul>
		<li><a href="javascript:void(0)">Live chat</a></li>
		<li><a class="qmparent" href="javascript:void(0)">Klanten</a>

			<ul>
			<li><a href="javascript:void(0)">IT Pro</a></li>
			<li><a href="javascript:void(0)">P2</a></li>
			<li><a href="javascript:void(0)">TypischTindemans</a></li>
            <li><a href="javascript:void(0)">Bastiaans Evenementen</a></li>
			<li><a href="javascript:void(0)">StonesPoint.org</a></li>
			</ul></li>
        
		<li><a class="qmparent" href="javascript:void(0)">Klant aan het woord</a>

			<ul>
			<li><a href="javascript:void(0)">Sjoerd de Waard</a></li>
			<li><a href="javascript:void(0)">Maaike Tindemans</a></li>
			</ul></li>
            
		<li><a href="javascript:void(0)">Login</a></li>
		</ul></li>

	<li><a class="qmparent" href="javascript:void(0)"><img src="images/menu_offerte.jpg" alt="Offerte aanvraag" width="133" height="17" border="0"></a>

		<ul>
		<li><a href="javascript:void(0)">Offerte aanvraag</a></li>
		<li><a href="javascript:void(0)">Site Check</a></li>
		</ul></li>

	<li><a class="qmparent" href="javascript:void(0)"><img src="images/menu_belmij.jpg" alt="Bel mij!" width="133" height="17" border="0"></a></li>

	<li><a class="qmparent" href="javascript:void(0)"><img src="images/menu_contact.jpg" alt="Contact" width="133" height="17" border="0"></a>

		<ul>
		<li><a href="javascript:void(0)">Contactgegevens</a></li>
        <li><a href="javascript:void(0)">Contactformulier</a></li>
		<li><a href="javascript:void(0)">Algemene voorwaarden</a></li>
		</ul></li>

<li class="qmclear"> </li></ul>

<!-- Create Menu Settings: (Menu ID, Is Vertical, Show Timer, Hide Timer, On Click (options: 'all' * 'all-always-open' * 'main' * 'lev2'), Right to Left, Horizontal Subs, Flush Left, Flush Top) -->
<__script__ type="text/javascript">qm_create(0,true,0,500,'all',false,false,false,false);</__script>
</div></TD> 
                    </TR> 
                    <TR> 
                      <TD height="24" BGCOLOR="#FFFFFF"><IMG SRC="images/trans.gif" WIDTH="20" HEIGHT="2"></TD> 
                    </TR> 
                    <TR> 
                      <TD COLSPAN="2"> </TD> 
                    </TR> 
                    </TABLE></TD> 
                  <TD WIDTH="35"><IMG SRC="images/trans.gif" WIDTH="35" HEIGHT="5"></TD> 
              </TR> 
                <TR> 
                  <TD VALIGN="BOTTOM"> </TD> 
              </TR> 
          </TABLE></TD> 
        </TR> 
        <!-- EINDE EERSTE DRIE KOLOMMEN --> 
        <TR> 
          <TD BGCOLOR="#FFFFFF"><IMG SRC="images/trans.gif" WIDTH="20" HEIGHT="35" BORDER="0"></TD> 
        </TR> 
        <TR> 
          <TD BGCOLOR="#FFFFFF"><TABLE width="773" BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="20">
 <TR>
   <TD HEIGHT="20" CLASS="copyright">© Copyright 2008 InTouch Design</TD>
 </TR>
</TABLE>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" HEIGHT="60">
   <TR>
	 <TD WIDTH="50" valign="bottom" CLASS="lichtgrijs"><IMG ALT="" SRC="images/trans.gif" WIDTH="50" HEIGHT="20" BORDER="0"></TD>
	 <TD WIDTH="335" CLASS="lichtgrijs" VALIGN="BOTTOM"><IMG ALT="" SRC="images/trans.gif" WIDTH="335" HEIGHT="20" BORDER="0"></TD>
	 <TD WIDTH="388" ALIGN="RIGHT" VALIGN="BOTTOM"><IMG ALT="InTouch Design" SRC="images/logo_onder.gif" BORDER="0"></TD>
   </TR>
</TABLE></TD> 
        </TR> 
      </TABLE></TD> 
    <TD WIDTH="1"><IMG SRC="images/trans.gif" WIDTH="1" HEIGHT="1" BORDER="0"></TD> 
  </TR> 
</TABLE> 
<__body>
</__html>
Last edited by realrock on Sun Oct 12, 2008 10:23 am, edited 1 time in total.
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: Javascipt can't load in CMS

Post by Dee »

Strange, the {literal} tags should only be needed if you insert actual JS code into the template, not if you link to an external js file.
I'm not getting the error on a refresh and the code just doesn't seem to display... it's almost as if you're editing the wrong template (or a cache problem).

I tested it here, simply added

Code: Select all

<__script__ src="AC_RunActiveContent.js" language="javascript"></__script>
<__script__ type='text/javascript' src='quickmenu1.js'></__script>
to a template, viewed the page and page source and the code is there...

Grtz,
D
realrock
Forum Members
Forum Members
Posts: 227
Joined: Tue Sep 04, 2007 8:14 pm

Re: Javascipt can't load in CMS

Post by realrock »

Dee wrote: Strange, the {literal} tags should only be needed if you insert actual JS code into the template, not if you link to an external js file.
I'm not getting the error on a refresh and the code just doesn't seem to display... it's almost as if you're editing the wrong template (or a cache problem).

I tested it here, simply added

Code: Select all

<__script__ src="AC_RunActiveContent.js" language="javascript"></__script>
<__script__ type='text/javascript' src='quickmenu1.js'></__script>
to a template, viewed the page and page source and the code is there...

Grtz,
D
Ah ok,  thats where the literal tag are for. I have delete them.

I'v deleted the cache, but that did't work. The error is only showing up at the first refresh after eatch edit.

Thanks for your help so far!
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

Re: Javascipt can't load in CMS

Post by Russ »

Isn't it or is it still erroring on this line?

Code: Select all

AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width','773','height','270','id','example_scroll_bar','align','middle','src','example_scroll_bar','quality','high','bgcolor','#ffffff','name','example_scroll_bar','allowscriptaccess','sameDomain','allowfullscreen','false','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','example_scroll_bar' ); //end AC code
There are other more compliant ways of adding flash including other UDT's listed in this forum.
realrock
Forum Members
Forum Members
Posts: 227
Joined: Tue Sep 04, 2007 8:14 pm

Re: Javascipt can't load in CMS

Post by realrock »

Russ wrote: Isn't it or is it still erroring on this line?

Code: Select all

AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width','773','height','270','id','example_scroll_bar','align','middle','src','example_scroll_bar','quality','high','bgcolor','#ffffff','name','example_scroll_bar','allowscriptaccess','sameDomain','allowfullscreen','false','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','example_scroll_bar' ); //end AC code
There are other more compliant ways of adding flash including other UDT's listed in this forum.
Can you give a example? ;)
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

Re: Javascipt can't load in CMS

Post by Russ »

Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: Javascipt can't load in CMS

Post by Dee »

Hmmm either I overlooked the code in the page source last time or it's there now :)

Try changing

Code: Select all

<__script__ src="uploads/AC_RunActiveContent.js" language="javascript"></__script>
to

Code: Select all

<__script__ src="AC_RunActiveContent.js" language="javascript"></__script>
(uploads/AC_RunActiveContent.js does not exist)

Grtz,
D
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: Javascipt can't load in CMS

Post by Dee »

PS/BTW for some more info about Smarty's {literal} tags, what they do and when they're needed, see the Smarty documentation
realrock
Forum Members
Forum Members
Posts: 227
Joined: Tue Sep 04, 2007 8:14 pm

Re: Javascipt can't load in CMS

Post by realrock »

Dee wrote: Hmmm either I overlooked the code in the page source last time or it's there now :)

Try changing

Code: Select all

<__script__ src="uploads/AC_RunActiveContent.js" language="javascript"></__script>
to

Code: Select all

<__script__ src="AC_RunActiveContent.js" language="javascript"></__script>
(uploads/AC_RunActiveContent.js does not exist)

Grtz,
D
I'v tried everyting with that file, so it on 3 differtent places ;D

Thanks for the help so far, I'm gonna try to put it all together this weekend, I'll let you no!
realrock
Forum Members
Forum Members
Posts: 227
Joined: Tue Sep 04, 2007 8:14 pm

Re: [Solved] Javascipt can't load in CMS

Post by realrock »

Thanks guys!, it works.

I'v used the opject tag and I'v replaced the orginal opject link.
Post Reply

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