We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25551 ☆ A M B ☆
    • 1,231 Posts
    Hey folks, got a couple things I need advice with.

    My modx site never seems to validate properly and I would appreciate some input on why and how to keep on top of it.
    Is it something to do with how MODx puts a site together or is it just cause of my poor development?

    I want to keep things compliant as I possibly can.

    Could someone tell me what the best practice is for web development? I don’t know if to use transitional or strict etc.

    Is the validation something I need to worry about?

    www.rossco-designs.com/home.html

    I have been reworking my website and what to make sure that everything is by the compliant book.

    Thanks for any advice.
      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
      AugmentBLU - MODX Partner

      BLUcart - MODX Revolution E-Commerce & Shopping Cart
      • 33372
      • 1,611 Posts
      MODx just spits out whatever you tell it to, so whether or not your site validates is up to you. Validation is important, since it can greatly improve cross-browser rendering of your design (as well as avoid more serious errors). I pretty much always use XHTML Transitional instead of Strict (mostly because I like using targets in my links to open URLs in new pages).

      Most of the errors in your home page come from the way that you’re embedding your Flash movie, so fix that and they’ll go away. The others are things that you should be glad it’s pointing out, like a missing form closing tag and duplicate ids (there can be only one of each id). Keep trying and you’ll see that green validation message very soon.
        "Things are not what they appear to be; nor are they otherwise." - Buddha

        "Well, gee, Buddha - that wasn't very helpful..." - ZAP

        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
        • 4310
        • 2,310 Posts
        For embedding Flash have a look at http://code.google.com/p/swfobject/
          • 33372
          • 1,611 Posts
          Quote from: bunk58 at Mar 06, 2008, 05:13 PM

          For embedding Flash have a look at http://code.google.com/p/swfobject/
          That what I always use. Keeps IE from displaying that annoying "Click to activate and use this control" dialog. I know that was the result of a lawsuit that wasn’t entirely Microsoft’s fault, but man is it irritating.
            "Things are not what they appear to be; nor are they otherwise." - Buddha

            "Well, gee, Buddha - that wasn't very helpful..." - ZAP

            Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
            • 4310
            • 2,310 Posts
            				<script type="text/javascript">
            			var flashvars = {};
            			var params = {};
            			var attributes = {};
            			swfobject.embedSWF("assets/resources/alg.swf", "myAlternativeContent", "800", "600", "9.0.0", false, flashvars, params, attributes);
            		</script>
            
            		<div id="myAlternativeContent">
            			<a href="http://www.adobe.com/go/getflashplayer">
            				<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
            			</a>
            		</div>
            
            

            Umm.. got this in my page and a call to the swfobect.js file in the head but all I’m getting is the "myAlternativeContent" div showing up?
            The alg.swf file is there and working when using the embed method on another page!
            More research is needed, I think there was a swfobject snippet somewhere.
            Note to self, go to bed now and look tomorrow.
              • 25551 ☆ A M B ☆
              • 1,231 Posts
              Thanks for the help so far guys. I had a look at swfobject and I used the following code

              		<div>
              			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="630" height="131" id="flashmenu">
              				<param name="movie" value="assets/flash/navigate.swf" />
              				<param name="wmode" value="transparent" />
              				<!--[if !IE]>-->
              				<object type="application/x-shockwave-flash" data="assets/flash/navigate.swf" width="630" height="131">
              					<param name="wmode" value="transparent" />
              				<!--<![endif]-->
              					<a href="http://www.adobe.com/go/getflashplayer">
              						<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
              					</a>
              				<!--[if !IE]>-->
              				</object>
              				<!--<![endif]-->
              			</object>
              		</div>


              this made the flash show up without including the swfobect.js file, How could this be?

              I’m using Firefox on Ubuntu and it appears in my browser without the need for the javascript file?

              What is the best practice for including SWF files in MODx? huh
                Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                AugmentBLU - MODX Partner

                BLUcart - MODX Revolution E-Commerce & Shopping Cart
                • 33372
                • 1,611 Posts
                MODx doesn’t really have much to do with this. You just need to know the "best" way to embed Flash movies in web pages in general. MODx will do whatever you tell it.

                The code that you posted is just a regular object embedding with some IE conditional comments mixed in, so that’s not using SWFobject at all. You don’t have to use SWFobject, but personally I prefer it since it works around that annoying "Click to activate" dialog in IE. But one could make the argument that it requires JavaScript to work and that’s unnecessary (although 93% of web users have JS turned on).

                So it’s up to you how you want to embed this in your page...
                  "Things are not what they appear to be; nor are they otherwise." - Buddha

                  "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

                  Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                  • 25551 ☆ A M B ☆
                  • 1,231 Posts
                  Ok so do I have to include the swfobject script using a snippet or can i just include the javascript in the header of a page?
                    Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                    AugmentBLU - MODX Partner

                    BLUcart - MODX Revolution E-Commerce & Shopping Cart
                    • 4310
                    • 2,310 Posts
                    You need to reference the swfobect.js in the head section for any pages you want to use it on.
                    <script src="assets/js/swfobject.js" type="text/javascript"></script>

                    You can then add manually page by page or dynamically by using the snippet.
                    For example I have put it in the header section of my main template s it’s on each page
                    <div id="flashcontent">
                    			<a href="http://www.adobe.com/go/getflashplayer">
                    				<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
                    			</a>
                    		</div>
                    <script type="text/javascript">
                    var fo = new SWFObject("assets/resources/alg.swf", "flashcontent", "800", "600", "6", "#FFFFFF");
                    fo.addVariable("variable", "varvalue");
                    fo.write("flashcontent");
                    </script> 

                    Note you must have the flash<div> before the JS or it doesn’t work, as I found out after some head scratching!
                      • 25551 ☆ A M B ☆
                      • 1,231 Posts
                      I tried what you put and it didn’t work.

                      I put the script line in the head area and the code for the flash div and script where the flash is to go in the body.

                      I’m using linux so I only have FF on here so I can’t test for IE just yet as my work pc is offline for now.

                      I used these lines in the body and included the javascript in the head area. It works but not sure if it’s doing what it should... by passing the click to activate thing.

                      <div id="flashcontent">
                      						<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="630" height="131" id="flashmenu">
                      				<param name="movie" value="assets/flash/navigate.swf" />
                      				<param name="wmode" value="transparent" />
                      				<!--[if !IE]>-->
                      				<object type="application/x-shockwave-flash" data="assets/flash/navigate.swf" width="630" height="131">
                      					<param name="wmode" value="transparent" />
                      				<!--<![endif]-->
                      					<a href="http://www.adobe.com/go/getflashplayer">
                      						<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
                      					</a>
                      				<!--[if !IE]>-->
                      				</object>
                      				<!--<![endif]-->
                      			</object>
                      		</div>
                      <script type="text/javascript">
                      var fo = new SWFObject("assets/flash/navigate.swf", "flashcontent", "630", "131", "6", "#FFFFFF");
                      fo.addVariable("variable", "varvalue");
                      fo.write("flashcontent");
                      </script> 
                        Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                        AugmentBLU - MODX Partner

                        BLUcart - MODX Revolution E-Commerce & Shopping Cart