ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Apparent confusion over file paths as EE relates to them?

November 02, 2009 12:37pm

Subscribe [2]
  • #1 / Nov 02, 2009 12:37pm

    Attempting to use javascript to embed a flash object. The following code works when removed from Expression Engine and placed in an index.html file on the server, but does not work when inserted into the site index page within EE.

    ...
            var flashvars = {};
            flashvars.xml = "includes/config.xml";
            flashvars.font = "includes/miso_font.swf";
            var attributes = {};
            attributes.wmode = "transparent";
            attributes.id = "slider";
            swfobject.embedSWF("http://www.sitename.com/includes/cu3er.swf", "cu3er-container", "920", "247", "9", "includes/expressInstall.swf", flashvars, attributes);
    ...

    Does it have to do with trying to find the “cu3er-container” parameter as the flash file (on the server) relates to the css file (in Expression Engine)? Is this causing incorrect file paths? Yet, I have hard-coded paths to files and images with no luck.

  • #2 / Nov 02, 2009 1:52pm

    Lisa Wess

    20502 posts

    ExpressionEngine templates are in template groups - these are like directories, but virtual - they don’t exist on the server.  Right now it’s trying to find, say, config.xml in your template group/includes/config.xml.

    The way to fix this is to use an absolute path.  Ie /includes/config., /includes/miso_font.swf.

    Moving over to How to for you.

  • #3 / Nov 02, 2009 3:22pm

    Thanks, Lisa - was certain I had hard-coded all the paths correctly, but apparently had not ...because after checking and rechecking myself, I have it working. Sorry for not catching my simple mistake sooner 😊 ...have a great day!

  • #4 / Nov 04, 2009 11:31pm

    It wasn’t just a case of missing a simple mistake - why it was difficult to get working is unexplainable. Also, why the code that WAS working, has stopped working even though nothing had been changed. I can extract the code, place it on the server as an html file with absolute paths. Move the same code WITH ABSOLUTE PATHS into EE and it won’t work. Has anyone else had an issue with EE not being able to embed a flash object using javascript?

    var flashvars = {};
            flashvars.xml = "http://www.sitename.com/includes/config.xml";
            flashvars.font = "http://www.sitename.com/includes/miso_font.swf";
            var attributes = {};
            attributes.wmode = "transparent";
            attributes.id = "slider";
            swfobject.embedSWF("http://www.sitename.com/includes/cu3er.swf", "cu3er-container", "920", "247", "9", "includes/expressInstall.swf", flashvars, attributes);
  • #5 / Nov 05, 2009 2:01am

    Lisa Wess

    20502 posts

    “includes/expressInstall.swf

    That needs fixing.

  • #6 / Nov 05, 2009 4:25am

    silenz

    1651 posts

    A leading slash is probably enough. That tells HTML-clients to start from the root-dir.
    Without leading slash the relative URL gets appended to the current URL.

  • #7 / Nov 05, 2009 9:16am

    Thanks for the replies ...by adding a leading slash, do you mean:

    var flashvars = {};
          flashvars.xml = "http://www.sitename.com/includes/config.xml";
          flashvars.font = "http://www.sitename.com/includes/miso_font.swf";
          var attributes = {};
          attributes.wmode = "transparent";
          attributes.id = "slider";
          swfobject.embedSWF(“http://www.sitename.com/includes/cu3er.swf”, "cu3er-container", "920", "247", "9", "/includes/expressInstall.swf", flashvars, attributes);

    Which doesn’t work :-(

    I have to get it to go to the server for this script, correct? ...so the first parameter of the swfobject.embedSWF needs to be the absolute url.

    Once it’s out there, on the server, running that script - I wouldn’t want the absolute path to other parameter I wouldn’t think ...although I’ve tried that too and it didn’t work:

    var flashvars = {};
          flashvars.xml = "http://www.sitename.com/includes/config.xml";
          flashvars.font = "http://www.sitename.com/includes/miso_font.swf";
          var attributes = {};
          attributes.wmode = "transparent";
          attributes.id = "slider";
          swfobject.embedSWF("http://www.sitename.com/includes/cu3er.swf", "cu3er-container", "920", "247, "9", "http://www.sitename.com/includes/js/expressInstall.swf", flashvars, attributes);

    Confusing for me is that the absolute path includes the “js” folder (where the expressInstall.swf file actually resides) but the working script is written as “includes/expressInstall.swf” for the given parameter.

  • #8 / Nov 05, 2009 10:36pm

    If it’s not possible to get EE to process a particular script - is there a way to go outside of EE just long enough to let the script do it’s thing and then return to EE for everything else? I’ve not ever had this much difficulty with any other script etc - I’ve tried every possible combination ...the script runs fine until bringing it into EE.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases