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.

More include confustion

December 13, 2008 7:55pm

Subscribe [1]
  • #1 / Dec 13, 2008 7:55pm

    Dr. Seuss

    58 posts

    On a previous project, I could not get my CSS and JS files to load.  Thankfully, folks offered great suggestions here which fixed the problem.

    The way that I fixed the problem was to place all of my include files at the same level as the “system” folder.  It worked great, but then I went to another project.  I made a new copy of the old project and started modifying files…so the file structure looks like this:

    |  .htaccess
    |  .project
    |  index.php
    |  license.txt
    |  newProject

    +—-public
    |  |  index.html
    |  | 
    |  +—-admin
    |  |  |  index.html
    |  |  | 
    |  |  +—-css
    |  |  |    admin_console.css
    |  |  |    index.html
    |  |  |   
    |  |  +—-images
    |  |  |    background.jpg
    |  |  |    cross.png
    |  |  |    index.html
    |  |  |    login_toggle.jpg
    |  |  |    nav_bg.jpg
    |  |  |    nav_separator.jpg
    |  |  |    pencil.png
    |  |  |    Thumbs.db
    |  |  |    transparent.gif
    |  |  |    zoom.png
    |  |  |   
    |  |  \—-js
    |  |        index.html
    |  |       
    |  +—-frontend
    |  |  +—-css
    |  |  |    fal_style.css
    |  |  |   
    |  |  +—-images
    |  |  |    browse_crag_bg.jpg
    |  |  |    bullet.gif
    |  |  |    footer_bg.jpg
    |  |  |    header.jpg
    |  |  |    Thumbs.db
    |  |  |    tick.png
    |  |  |   
    |  |  \—-js
    |  |        index.html
    |  |       
    |  +—-images
    |  |  |  index.html
    |  |  | 
    |  |  \—-captcha
    |  |        base_image.jpg
    |  |        index.html
    |  |       
    |  \—-shared
    |    |  index.html
    |    | 
    |    +—-css
    |    |    index.html
    |    |   
    |    +—-images
    |    |    arrow.gif
    |    |    error.png
    |    |    index.html
    |    |   
    |    \—-js
    |          flash.js
    |          index.html
    |          jquery.js
    |         
    +—-rad (system)
    |  +—-application
    |  |  |  index.html
    |  |  | 
    |  |  +—-config
    |  |  |   
    |  |  +—-controllers
    |  |  |  |  index.html
    |  |  |  |  welcome.php
    |  |  |  | 
    |  |  |  +—-home
    |  |  |  |    home.php
    |  |  |  |   
    |  |  |  \—-siteignite
    |  |  |        designmenu.php
    |  |  |       
    |  |  +—-errors
    |  |  |   
    |  |  +—-helpers
    |  |  |    index.html
    |  |  |   
    |  |  +—-hooks
    |  |  |    index.html
    |  |  |   
    |  |  +—-language
    |  |  |       
    |  |  +—-libraries
    |  |  |    asset_linker.php
    |  |  |    index.html
    |  |  |   
    |  |  +—-models
    |  |  |  |  index.html
    |  |  |  | 
    |  |  |  +—-common
    |  |  |  |    menu.php
    |  |  |  |   
    |  |  |  \—-siteignite
    |  |  |        treejson.php
    |  |  |       
    |  |  \—-views
    |  |    |  index.html
    |  |    |  welcome_message.php
    |  |    | 
    |  |    +—-common
    |  |    |    body.php
    |  |    |    col2.php
    |  |    |    col3.php
    |  |    |    footer.php
    |  |    |    header.php
    |  |    |    header_admin.php
    |  |    |    header_site.php
    |  |    |    menu.php
    |  |    |   
    |  |    +—-home
    |  |    |    body.php
    |  |    |    container.php
    |  |    |   
    |  |    \—-siteignite
    |  |          body.php
    |  |          container.php
    |  |         
    |  +—-cache
    |  |    index.html
    |  |   
    |  +—-codeigniter
    |       
    +—-_css
    |    3col.css
    |    prettify.css
    |    style.css
    |    superfish.css
    |    tree_component.css
    |   
    +—-_images
    |  \—-tree
    |        dot.gif
    |        fminus.gif
    |        fminus_rtl.gif
    |        fplus.gif
    |        fplus_rtl.gif
    |        lastli.gif
    |        lastli_rtl.gif
    |        li.gif
    |        marker.gif
    |        marker_rtl.gif
    |        plus.gif
    |        remove.png
    |        throbber.gif
    |       
    \—-_js
          bubble.js
          css.js
          hoverIntent.js
          jquery-1.2.6.min.js
          jquery.bgiframe.min.js
          jquery.form.js
          jquery.listen.js
          superfish.js
          supersubs.js
          tree_component.js
          _all.js


    Please note the following:
    *  I have copied the “asset_linker” files into this project, but it is not being used yet as I do not completely understand it.

    *  In the first project, there was no .htaccess file.  The contents of this project’s .htacess file are:

    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|robots\.txt)
    RewriteRule ^(.*)$ /index.php/$1 [L]

    I have tried deleting the .htacess file and I still cannot get my CSS and JS files to load, so I am unsure if it is the problem.

    *  The CSS and JS files are being called from the directories “_css” and “_js” respectively.


    What I am doing is implementing the “partial” view method.  You can see the current controller result here.  If you view the HTML source, you see that the js and css files’ full paths are present…

    <!-- COMPONENTS -->
      [removed][removed]
      [removed][removed]
    
      [removed][removed]
    
      <link rel="stylesheet" type="text/css" href="http://radsrc.fastcheapweb.com/_css/tree_component.css" />
      <link rel="stylesheet" type="text/css" href="../../_css/style.css" />

    ...and you can see from the “tree” listing above that the files are present in their “system” peer level directories.

    But you can obviously see that it is not working. :red:

    What am I doing wrong?  As always, I do appreciate the help.

  • #2 / Dec 14, 2008 4:41pm

    Dr. Seuss

    58 posts

    Just noticed that the initial post had some oddness in the display of the included javascript files.  I am removing the [type=“text/javascript”] and [.js] extensions in hopes that the wiki editor does not delete the samples

    <!-- COMPONENTS -->
      [removed][removed]
      [removed][removed]
    
      [removed][removed]
    
      <link rel="stylesheet" type="text/css" href="http://radsrc.fastcheapweb.com/_css/tree_component.css" />
      <link rel="stylesheet" type="text/css" href="../../_css/style.css" />

    What you need to know—and can see if you look at the HTML source—is that I am using the base_url() CI function, it is working as expected, and the full path to the client-side includes appears to be correct. 

    But my CI installation is not returning the files either in this page or if I paste the direct URL in the browswer address.  BTW, above where it says [href=”../../_css/style.css” ] is just me trying different stuff to get the path to resolve; the “href=“http://radsrc.fastcheapweb.com/_css/tree_component.css”” is actually representative of what “should” work based on what worked in the previous project.

    I have tried every “relative URL” combination that I can think of and nothing seems to work.

    Lastly, the .htacess file cited in the original post was copied directly from the User Guide recommendation.

    Is there an explanation somewhere of how GI “navigates” folders?  Prior to this I was under the impression that every request to a site was interpreted “as if” the system folder was the site root; this is not true, is it?

    Thanks to everyone for reading this.

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

ExpressionEngine News!

#eecms, #events, #releases