Hi,
Until now I have always put my .css-file in “Shares Resources / Style Sheets”. Now I’ve seen that u can put the .css definitions in a page and set the content type to text/css. I’ve tryed this and it works what I can see great!
So now I wonder where should I really put the .css-file? Or does it really matter if I put in Shared Resources or in a page?
Having it in a page makes it really easy to update.
How do u do and where do u put your css?
Subject: Where to put the CSS file!?
Hi Richard,
Links to external stylesheets go into the header so put something like this in the HTML Head Content section:
“<link type="text/css" rel="stylesheet" href="/” + @WebDbName + “/pagename.css" />”
HTH,
Joost
Subject: RE: Where to put the CSS file!?
The company I work for uses a profile document to store the CSS code as a field value, which is then pulled into the forms and pages using @GetProfileField in the “HTML Head Content”.
i.e. “@GetProfileField(“PRdoc1”;“StyleSheet_DG”)”
This allows the web content team access to modify the style sheet without having to update the design.
We’ve been using this for years, and the users love it!
Subject: RE: Where to put the CSS file!?
Hi Joost,
Got that one!
Maybe I was not really clear about what I ment.
But I use external css-files and today I put them like I said in “Shared Resources” and “Style Sheets”.
As I said I now found a different way to use external css-files, and that is to put all the css-definitions in a Page and set that to text/css. This works what I think great.
What I really wonder is. Where is the best place to put the external css-file? In Shared Resources or in a Page?
How do u do it? Where do u place your external css-files?
And where is the best place to store it?
Subject: RE: Where to put the CSS file!?
Hi Richard,
As long as you have the URL/URI of the external stylesheet, you can link it in. I usually put them into the shared resources. I suppose it’s a matter of personal preferences.
Joost
Subject: RE: Where to put the CSS file!?
IBM’s intention is to have us store them as shared resources. In fact, this option was new with Notes 6, whereas you could use a page to store CSS from Notes 5 on.
Advantages of using a page vs. using a StyleSheet resource:
Disadvantages of using a page vs. using a StyleSheet resource:
-
No syntax checking or even just highlighting.
-
No sensible caching if using computed text
-
Potentially slower
-
Not usable for Client applications
-
Harder to create the link
While this is mostly a matter of personal taste, I prefer to use StyleSheet resources. What appears to be pro arguments for the page (less clicks to update) can easily impact the quality (missing syntax checking) and might encourage you to not spend enough time thinking about a good caching strategy.
Subject: RE: Where to put the CSS file!?
Pages can’t be used as CSS “files” in the Notes client, so if you are doing cross-client development, there’s not a lot of choice there. Nor will you ever have to worry about the MIME type of a CSS resource. Both of those are “should”-type arguments, if you ask me.
As for the argument that Pages are somehow easier to maintain, well, I must have a broken Designer installation – I can’t find the “Open With” button for Pages that will let me use a clued-in editor (TopStyle, Aptana, or what have you). I’ll grant one advantage to Pages (or Forms) – you can use computed text. How often do you need to do that? How many rules do you need computed when you do want to change things up?