Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Need CSS files in the root

  1. #1
    Senior Member LBA's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    543

    Default Need CSS files in the root

    I'm publishing By Asset Type and the HTML folder is .htaccess password protected, so only the home page should be accessible to the public. But the home page contains calls to CSS files that are only published in the protected HTML directory.

    <LINK REL="STYLESHEET" TYPE="text/css" HREF="./html/fusion.css">
    <LINK REL="STYLESHEET" TYPE="text/css" HREF="./html/style.css">
    <LINK REL="STYLESHEET" TYPE="text/css" HREF="./html/site.css">

    That's a problem because the home page won't load properly without accessing those protected CSS files. Didn't Fusion used to publish a set of CSS files in the root folder, as well as the sub-folders? How to make that happen?

  2. #2
    Senior Member RayC's Avatar
    Join Date
    Apr 2010
    Location
    Toronto-ish, Canada
    Posts
    1,732

    Default

    I don't think it's "proper" for a site to have duplicate versions of the CSS file(s). The only sure way to do this would be to split the site into multiple .NODs and publish separately.

    You might be able to do this using "Exclude from Navigation", which is apparently intended to create a "site-within-a-site" type of structure. You'd have to try a test to see if that also generates separate CSS files. And, yes, this function is poorly named.

    Also... If you publish by Site Structure or Flat, the CSS files are placed in the root. If you want to keep your site arrange by Asset Type, you could manually move the CSS files to the root in Publish View. Your protected pages should have no problem accessing the CSS files in the unprotected root.

    HTH
    Ray Cambpell
    Sounds In Sync
    Linked in

  3. #3
    Senior Member LBA's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    543

    Default

    Something has changed. When I look on the server, I see the CSS files are in the root as well as in the HTML folder... and when I look at the source code of a copy of the home page on archive.org from a year ago, it id looking for CSS files in the root. What changed? Why is the NOF home page looking for CSS files in a different folder?

  4. #4
    Senior Member franko's Avatar
    Join Date
    Apr 2010
    Location
    Tasmania Australia
    Posts
    2,642

    Default

    To be honest, I'd simply ftp the css files to the root. It won't do any harm having them there as well as in the html directory as the index page will look for them in the root and the html pages will look for them in the /html directory.

    As to why they are now in the /html directory and they used to be in the root directory, I can't say.

    Also, couldn't you have simply edited the .htaccess file to allow index.html to not require a password?

  5. #5
    Senior Member LBA's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    543

    Default

    FTP'ing the CSS files won't help (and besides, they're already in the root because NOF used to put them there) because NOF is now auto-generating code that looks for CSS files in the HTML folder. If I could disable that code, I could simply write my own calls to CSS in the root folder. I don't think your suggestion can be done but I had tried writing .htaccess the opposite way... to exclude the CSS files from password protection... but for some reason my syntax isn't working.

  6. #6
    Senior Member RayC's Avatar
    Join Date
    Apr 2010
    Location
    Toronto-ish, Canada
    Posts
    1,732

    Default

    Have you tried manually moving the CSS files to the root in Publish View in NOF. This should update all NOF generated code to point to the CSS files there. Certainly easier than writing custom code...
    Ray Cambpell
    Sounds In Sync
    Linked in

  7. #7
    Senior Member LBA's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    543

    Default

    NOF doesn't list the files in Publish View so you don't have the opportunity to move them out of the HTML folder. You can FTP them, of course, but the NOF-generated code still insists on finding them in the HTML folder.

    <LINK REL="STYLESHEET" TYPE="text/css" HREF="./html/fusion.css">
    <LINK REL="STYLESHEET" TYPE="text/css" HREF="./html/style.css">
    <LINK REL="STYLESHEET" TYPE="text/css" HREF="./html/site.css">

    Is there a way to tell NOF to look for it's CSS files somewhere else?

    P.S. I always publish Flat now, but in my older sites where I published by Asset Type, I see a set of CSS files in the Root as well as in the HTML folder. It seems that NOF has stopped doing that... and this is the source of the problem. Hey NOF guys... did you change that? If there ever is a version XIII, can you change it back?
    Last edited by LBA; 01-04-2013 at 02:38 PM.

  8. #8
    Senior Member RayC's Avatar
    Join Date
    Apr 2010
    Location
    Toronto-ish, Canada
    Posts
    1,732

    Default

    Here's a little trick you can try -- it worked for me.

    (You might want to try this on a COPY of your site.)

    Change the site to Arrange Files -> by Site Structure. You will (may?) now see the various CSS files in the root.
    Change back to Arrange Files -> by Asset Type. The CSS files will (may?) still be visible

    Now you can cut/paste them where you want them. What I'm seeing is that once this is done, even if you change "Arrange Files" again, they stay where you've put them.
    Ray Cambpell
    Sounds In Sync
    Linked in

  9. #9
    Senior Member LBA's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    543

    Default

    I just tried this with a newly created 1-page test site:

    - Set to publish by Asset Type... Local Publish... view source... Home page looks for CSS files in the HTML folder.
    - Change publish to Flat... Local Publish... view source... Home page looks for CSS files in the root.
    - Change publish to Asset Type... Local Publish... view source... Home page again looks for CSS files in the HTML folder.

  10. #10
    Senior Member RayC's Avatar
    Join Date
    Apr 2010
    Location
    Toronto-ish, Canada
    Posts
    1,732

    Default

    Sorry, I guess I wasn't clear -- made sense inside my head.

    Once you've switched to Site Structure, you will see the CSS files listed in Publish View -- then you can move them to the root folder. Then you can switch back to Asset Type, and they should still be listed in Publish View.
    Ray Cambpell
    Sounds In Sync
    Linked in

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •