Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Daniel Blomberg 21 posts 41 karma points
    Dec 08, 2011 @ 17:17
    Daniel Blomberg
    0

    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

  • Warren Buckley 2087 posts 4568 karma points MVP 6x admin hq c-trib
    Dec 08, 2011 @ 17:23
    Warren Buckley
    0

    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 

  • Daniel Blomberg 21 posts 41 karma points
    Dec 09, 2011 @ 11:24
    Daniel Blomberg
    0

    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

  • Warren Buckley 2087 posts 4568 karma points MVP 6x admin hq c-trib
    Dec 09, 2011 @ 11:29
    Warren Buckley
    0

    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 

  • Daniel Blomberg 21 posts 41 karma points
    Dec 09, 2011 @ 15:08
    Daniel Blomberg
    0

    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

  • Daniel Blomberg 21 posts 41 karma points
    Dec 09, 2011 @ 15:13
    Daniel Blomberg
    0

    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

  • Daniel Blomberg 21 posts 41 karma points
    Dec 09, 2011 @ 15:27
    Daniel Blomberg
    0

    One more thing:) Does the same pathing logic apply to the scripts?

    Best and have a nice week end!

    / Daniel

  • Warren Buckley 2087 posts 4568 karma points MVP 6x admin hq c-trib
    Dec 11, 2011 @ 12:41
    Warren Buckley
    0
    Hi Daniel,
    First of all yes CSS and JavaScript file references work both in the same way.
    In regards to why some worked and some didn't:
    These pages would have worked
    Etc...
    These pages would have not worked with CSS and JS without the / at the beginning of the CSS and JS file references:
    etc...
    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.
    Cheers,
    Warren
  • Daniel Blomberg 21 posts 41 karma points
    Dec 12, 2011 @ 10:39
    Daniel Blomberg
    0

    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

     

  • Warren Buckley 2087 posts 4568 karma points MVP 6x admin hq c-trib
    Dec 12, 2011 @ 10:44
    Warren Buckley
    0

    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.

  • Daniel Blomberg 21 posts 41 karma points
    Dec 12, 2011 @ 11:11
    Daniel Blomberg
    0

    Agin Warren, TY! I am amazed at how quick you response and how nice you are:)

  • Warren Buckley 2087 posts 4568 karma points MVP 6x admin hq c-trib
    Dec 12, 2011 @ 11:13
    Warren Buckley
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft