I am currently trying to finisg the CWS-tutorial but has been stuck on a CSS-problem fpr a while now. I can't seem to get the CSS working on any of the pages that has a substructure of more than one, i.e. Event Item, News Item, Gallery etc. It works perfectly on the other pages. What am I missing?
Hi Daniel, This is not Umbraco specific but more related to HTML/CSS.
When you goto a page that is not the top level page such as home, about etc... your path to the CSS file would work correctly, however when you go down a level or two the path to the CSS file would not work.
For example mysite.co.uk/galleries/my-gallery.aspx
The URL works in a similar way to a folder path, it assumes there is a folder called galleries in your website (but obviously isn't as Umbraco is all dynamic and creates these pages/urls for you) So the previous CSS path you had would say look in the galleries folder for a folder called css and in that folder look for a file called my-styles.css
So by starting the path to the CSS file with a / means that it will look in the root folder of your site, so when in the galleries section it would assume to walk all the way upto the top folder and then find a folder called CSS with my-styles.css which is what we actually have on disk.
Hope this make sense. If not I will try to explain it better.
yes I understand the functionality of it. But I can't understand how it could work before (accept for Gallery etc.). If i take a look on the structure of the site in webmatrix I can see the folders. All my templates are situatedunder the masterpages folder. So how did some of them worke earlier and some did not? I have always found these things a bit pussling and hard to figure out.
I also have difficulties with my photos. The specific photos doesn't pop up on the screen when selected from a gallery. I can't find anything different in it's corresponsing template. I have tried to make sense of the macro/xslt but can't find any apparent mistakes/faults. Do you have any idea what it could be?
As you noticed in WebMatrix all the templates live I side the masterpages folder but again when you write HTML and your URL includes a folder like the second set of example urls it would expect to find the CSS folder inside that galleries folder. But as you notice in WebMatrix there is no folder inside your files called galleries. We use umbraco to generate the page urls dynamically and all of pages we create inside umbraco don't ever create files inside your files in WebMatrix.
I hope this becomes clearer but may I suggest to look at some HTML tutorials on relative and absolute file paths to give you a better understanding of this.
Hi Warren thank you again for being so kind to help me. It is starting to get a bit clearer. I will definitely check out some tutorials regarding relative and absolute paths in HTML.
No problem Daniel, we have all been beginners at one point or another. Also we like to keep up the moto of 'Umbraco: The Friendly CMS' with being a polite, friendly and useful community.
Problem with CSS
Hi,
I am currently trying to finisg the CWS-tutorial but has been stuck on a CSS-problem fpr a while now. I can't seem to get the CSS working on any of the pages that has a substructure of more than one, i.e. Event Item, News Item, Gallery etc. It works perfectly on the other pages. What am I missing?
Best, Daniel
Hi Daniel,
This is probably to do with the path of the CSS file in the masterpage.
Ensure your CSS file starts with a /
So for example
/css/my-styles.css
Warren
Hi Warren,
thank you very much! This was correct. I never thought of this because it worked on the other pages/templates. How come that I had to change this?
Best, Daniel
Hi Daniel,
This is not Umbraco specific but more related to HTML/CSS.
When you goto a page that is not the top level page such as home, about etc... your path to the CSS file would work correctly, however when you go down a level or two the path to the CSS file would not work.
For example
mysite.co.uk/galleries/my-gallery.aspx
The URL works in a similar way to a folder path, it assumes there is a folder called galleries in your website (but obviously isn't as Umbraco is all dynamic and creates these pages/urls for you) So the previous CSS path you had would say look in the galleries folder for a folder called css and in that folder look for a file called my-styles.css
So by starting the path to the CSS file with a / means that it will look in the root folder of your site, so when in the galleries section it would assume to walk all the way upto the top folder and then find a folder called CSS with my-styles.css which is what we actually have on disk.
Hope this make sense.
If not I will try to explain it better.
Cheers,
Warren
Hi Warren,
yes I understand the functionality of it. But I can't understand how it could work before (accept for Gallery etc.). If i take a look on the structure of the site in webmatrix I can see the folders. All my templates are situatedunder the masterpages folder. So how did some of them worke earlier and some did not? I have always found these things a bit pussling and hard to figure out.
Thank you for your patience and quick responses!
Cheers, Daniel
Hi again,
I also have difficulties with my photos. The specific photos doesn't pop up on the screen when selected from a gallery. I can't find anything different in it's corresponsing template. I have tried to make sense of the macro/xslt but can't find any apparent mistakes/faults. Do you have any idea what it could be?
Best, Daniel
One more thing:) Does the same pathing logic apply to the scripts?
Best and have a nice week end!
/ Daniel
Hi Warren thank you again for being so kind to help me. It is starting to get a bit clearer. I will definitely check out some tutorials regarding relative and absolute paths in HTML.
Cheers, Daniel
I just did a quick google and this seems to be a good tutorial http://www.communitymx.com/content/article.cfm?cid=230ad
But there are plenty of tutorials out there on this subject.
But I am glad to hear it's making sense.
Agin Warren, TY! I am amazed at how quick you response and how nice you are:)
No problem Daniel, we have all been beginners at one point or another.
Also we like to keep up the moto of 'Umbraco: The Friendly CMS' with being a polite, friendly and useful community.
Warren
is working on a reply...