-
1. Re: Appropriate Linking and Folder Structure in BC
mario_gudelj May 20, 2012 10:30 PM (in response to Tarik :: Creativaholic)Hi there,
The best practice is to always denote root folder (/) in your paths. If you use a path without / e.g. Assets/images/img2.jpg, the browser will be able to find that image if you're at somedomain.com/index.html, but if you're at somedomain.com/somefolder/index.html, the browser will look for Assets folder, inside the current folder instead of starting from the root.
I hope that helps!
-mario
-
2. Re: Appropriate Linking and Folder Structure in BC
Tarik :: Creativaholic May 20, 2012 11:03 PM (in response to mario_gudelj)Which means, in a sub page in this case "somedomain.com/somefolder/index.html" you'll have to point to "../Assets" right?
-
3. Re: Appropriate Linking and Folder Structure in BC
mario_gudelj May 20, 2012 11:27 PM (in response to Tarik :: Creativaholic)That's correct.
-
4. Re: Appropriate Linking and Folder Structure in BC
Tarik :: Creativaholic May 21, 2012 8:13 AM (in response to mario_gudelj)Hi Mario, I thought I sounded like a beginner in my last question but I'm not.
The reason I asked this question because I can confirm that my theory is true.
So here it goes:
I have index.html in the root folder as well as a stylesheet folder which has the modulestylesheet.css and global.css
in the global.css I have 2 classes, each with a different background image, and the first one's url is pointing to (../Assets/images/image1.jpg) and the second class is pointing to (/Assets/images/image2.jpg)
The weird thing is (which made me start this discussion in the first place) is that both of them work, even after clearing the cache, reloading and resetting the browser. Where in a typical hosting account, it will definitely break. Even in Dreamweaver it's breaking.
I'm a guy who is a bit funny to know why and how everything works (which I think is part of someone cursed with quality control).
This is why I needed some clarification on how this can be still possible, what is BC's logic behind this. I just don't like surprises in the future.
Thank you
-
5. Re: Appropriate Linking and Folder Structure in BC
Liam Dilley May 21, 2012 12:51 PM (in response to Tarik :: Creativaholic)Does not work in all cases though so do not break the convention of how BC has been implemented.
With a CMS true functioanlity targeting of files often will require you to place a system code tag or say php code tag with the CMS to insert the root/template location of the site.
BC implemented the great easy system of / as the means to read from the root.
It is pretty simple, it works very well, covers every aspect from web apps, sub folders, css... so it is good to keep to this and cosistancy as even if BC make infustructure changes this will continue to work, other path formats may change if they modify further the internal system file handing structure which for example when Liquid becomes availible has layotus under _system for example. Does not effect this of course but just an example of how BC can change system structures at any time.
-
6. Re: Appropriate Linking and Folder Structure in BC
Tarik :: Creativaholic May 21, 2012 7:14 PM (in response to Liam Dilley)Liam, I appreciate when you help everyone everyday from your own personal time, but a question: Why do you love to play mysterious sometimes
Anyway, what is that "Does not work in all cases?"
Are you suggesting that no matter where is the file located, we can always point to elements using "/Folder..." ?
-
7. Re: Appropriate Linking and Folder Structure in BC
Liam Dilley May 21, 2012 10:11 PM (in response to Tarik :: Creativaholic)I like people to figure it out for themselves and learn the system, HTML, Javascript etc and I know that annoys people sometimes but not going to change because people actually do learn if they get the old brain working for a few mins
To your latter part, yes, because it's BC's impelemntation for root access rather then making you use a tag all the time, it is very elleggant and wont be effect by any file management or structure changes unless massivly drastic.
-
8. Re: Appropriate Linking and Folder Structure in BC
Tarik :: Creativaholic May 22, 2012 12:44 AM (in response to Liam Dilley)HAHAHAHA, you're so funny.
-
9. Re: Appropriate Linking and Folder Structure in BC
Liam Dilley May 22, 2012 1:06 AM (in response to Tarik :: Creativaholic)There are a number of use cases around javascript, ajax for example.


