Page 1 of 1

Is a Flash Header possible for Grass Stains Template?

Posted: Wed Mar 14, 2007 1:53 pm
by ImmortalSon
Hi Everyone,

I am fairly new to CMSMS.  I have been using Mark's Grass Stains xml theme as a base template to learn different bits and pieces of how CMSMS works.  The current problem is that I am trying to insert titlebar1.swf Flash File into the template, instead of the static header JPEG image.  Does anyone know how this is done?

This is the code in the CSS where the JPEG is called in case someone knows how I am to amend this...

Code: Select all


/******* Structure and Layout *******/
body {
font-family:Arial, Helvetica, sans-serif; 
font-size: 9pt; 
color: #000000; 
background: #B4B8B7;
margin:10px 0 0 0;
padding:0 0 0 0;
background: #efefef url(images/bg.gif);
text-align:center;
}

[b].wrap {
width:780px;
margin:0 auto;
padding:0 0 0 0;
text-align:center;
background: #ffffff url(uploads/positiveFX/header2.jpg) no-repeat;
border:1px solid #295371;[/b]
}

.header {
clear:none;
width:770px;
height:25px;
margin:100px 0 0 0;
padding:0 0 0 0;
background:transparent;
color:#ffffff;
text-align:right;
}

.topnav {
clear:both;
width:780px;
height:21px;
margin:0 0 0 0;
padding:0 0 0 0;
background:#ffffff url(uploads/positiveFX/topnav_bg_grey.gif);
font-size:8pt;
}

.container {
clear:both;
width:760px;
margin:10px 10px 0 10px;
padding:0 0 0 0;
background:#ffffff;
color:#000000;
text-align:left;
}

.news_right {
float:right;
clear:both;
width:200px;
margin:0 0 5px 10px;
padding:0 10px 0 10px;
background:#557d9a;
color:#000000;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:8pt;
}

.news p {
margin:10px 10px;
}

.news_cnr_top {
background:url(images/cnr_tr.gif) no-repeat top right;
margin:0 -10px 0 -10px;
}

.news_cnr_bottom {
background:url(images/cnr_br.gif) no-repeat top right;
margin:0 -10px 0 -10px;
}

img.cnr {
width:8px;
height:8px;
border:none;
display: block !important;
}

.footer {
position:relative;
clear:both;
width:780px;
margin:0;
padding: 0;
background:#ffffff;
font-size:8pt;
text-align:center;
border-top:1px solid #295371;
}
 *html body #footer{margin:10px 0 0 0;}

div#flat{clear:both;width:66%;height:38px;margin:10px 0 20px;padding:0px}
div.left49 {float:left;width: 70%;}
div.right49 {float:right;width: 15%;text-align: right;}
div.left49 p{margin:0px 20px; padding:0px}
div.right49 p{margin:0; padding:0px}


I have also copied link to my test area below if you want to have a look.

http://www.amberleafmedia.co.uk/cmsmadesimple/index.php

Any help would be great,

R.

Re: Is a Flash Header possible for Grass Stains Template?

Posted: Wed Mar 14, 2007 3:17 pm
by Nullig
You add the flash in the template, not the CSS file.

In order to still be valid XHTML 1.0 Strict, you will need to download swfobject.js - you can get it at http://blog.deconcept.com/swfobject/.

Then in the head portion of your template you add..

Code: Select all

<__script__ type="text/javascript" src="uploads/scripts/swfobject.js"></__script>
Note: change the path to wherever you save the script.

Then in the header portion of your template you add:

Code: Select all

<div id="flashcontent"></div>
{literal}
<__script__ type="text/javascript">
// <![CDATA[
		
var so = new SWFObject("path/to/movie.swf", "movie", "100", "80", "7", "#666666");
so.addParam("wmode", "opaque");
so.write("flashcontent");
		
// ]]>
</__script>
{/literal}
You need to change the parameters to match your movie in this line:

var so = new SWFObject("path/to/moviename.swf", "moviename", "width", "height", "flash version", "background color");

And you can add a div#flashcontent to your stylesheet to control it's placement, etc.

I hope this helps.

Nullig

Re: Is a Flash Header possible for Grass Stains Template?

Posted: Thu Apr 05, 2007 1:28 pm
by Gregor
This works like a charm!!

Is it possible (and if so, how) to place the script-part in a UDT? In that case, when using more than one template, it is easier to place a tag than the code.

Thanks,
Gregor

Re: Is a Flash Header possible for Grass Stains Template?

Posted: Thu Apr 05, 2007 6:17 pm
by Nullig
I suppose you could create a UDT which contained the following:

Code: Select all

echo '<__script__ type="text/javascript" src="uploads/scripts/swfobject.js"></__script>';
Note: you would have to change the path to where you had the js script.

Nullig

Re: Is a Flash Header possible for Grass Stains Template?

Posted: Thu Apr 05, 2007 7:53 pm
by Gregor
Yep, thanks Nullig, this works :-) Still a lot to experience about CMSms

Re: Is a Flash Header possible for Grass Stains Template?

Posted: Thu Apr 05, 2007 10:08 pm
by kermit
Nullig wrote: You add the flash in the template, not the CSS file.

In order to still be valid XHTML 1.0 Strict, you will need to download swfobject.js - you can get it at http://blog.deconcept.com/swfobject/.

(snip)
no need for javascript here...

from http://www.ambience.sk/flash-valid.htm






too simple for words. ;)