From: Matthew M. <ma...@tu...> - 2002-10-14 13:00:31
|
Greetings, There is new code in CVS to support multiple style sheets. Here is how it works. There is a new file in the theme named browsers.txt. It contains a listing of perl search strings and the appropiate style sheet to use. For example: Opera::opera.css MSIE 5.5::explorer.css Netscape6::netscape.css The first part before the double colons is the perl search (pretty basic in this example). Afterwards is the name of the style sheet to load INSTEAD of style.css if the search is TRUE. Layout then: 1) checks for the existance of the browser.txt file. 2) if true, layout reads the file and parses the list 3) if the browser is found AND if the style sheet exists, layout puts the address of the style sheet in the {STYLE} tag 4) if no conditions are met successfully and if style.css exists, the {STYLE} tag is set to the style.css address. 5) if none of the conditions are met, {STYLE} is never initialized. Note that I removed the <link> tag and it is now echoed along with the address. I could also add a parameter to the browser.txt files so that {STYLE} will echo the entire style sheet instead of merely linking to it. That would allow for preprocessing of the style sheet before it hits the theme. Let me know what you think and I will update the documentation if all is kewl. Thanks, Matt Matthew McNaney Internet Systems Architect Electronic Student Services Email: ma...@tu... URL: http://phpwebsite.appstate.edu Phone: 828-262-6493 ICQ: 141057403 |
From: Adam M. <ad...@tu...> - 2002-10-14 13:58:30
|
I like the implementation. This way if you have 2 browsers who can share a style sheet you don't have to make one for "browser a" and one for "browser b". I have a question though...does it still relative link the style sheet or are you writing it to the {STYLE} variable as a <style></style>? If you relative link to the file, most browsers seem to read this file only once and cache it. But if it is included as a <style> tag, the browser is forced to get this on every page hit. Might be something to talk about? Adam > Greetings, > > There is new code in CVS to support multiple style sheets. Here is how > it works. > > There is a new file in the theme named browsers.txt. It contains a > listing of perl search strings and the appropiate style sheet to use. > For example: > > Opera::opera.css > MSIE 5.5::explorer.css > Netscape6::netscape.css > > The first part before the double colons is the perl search (pretty basic > in this example). Afterwards is the name of the style sheet to load > INSTEAD of style.css if the search is TRUE. > > Layout then: > 1) checks for the existance of the browser.txt file. > 2) if true, layout reads the file and parses the list > 3) if the browser is found AND if the style sheet exists, layout puts > the address of the style sheet in the {STYLE} tag > 4) if no conditions are met successfully and if style.css exists, the > {STYLE} tag is set to the style.css address. > 5) if none of the conditions are met, {STYLE} is never initialized. > > Note that I removed the <link> tag and it is now echoed along with the > address. > > I could also add a parameter to the browser.txt files so that {STYLE} > will echo the entire style sheet instead of merely linking to it. That > would allow for preprocessing of the style sheet before it hits the > theme. > > Let me know what you think and I will update the documentation if all is > kewl. > > Thanks, > Matt > > > > Matthew McNaney > Internet Systems Architect > Electronic Student Services > Email: ma...@tu... > URL: http://phpwebsite.appstate.edu > Phone: 828-262-6493 > ICQ: 141057403 > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers --------------------------------- Adam Morton Developer - Web Technology Group Appalachian State University http://phpwebsite.appstate.edu |
From: Matthew M. <ma...@tu...> - 2002-10-14 15:20:25
|
Currently, the {STYLE} tag will print <link rel="stylesheet" href="http://ww.mywebsite.com/themes/Default/style.css" type="text/css" /> What I was thinking is allowing the OPTION to replace the relative link with the <style></style>. This would only need implementation if their are circumstances in which the style sheet needs preprocessing (eg to replace {THEME_DIRECTORY} tags) before it hits the theme. As you can guess, you could not preprocess a linked file because it would have to be written on the fly (ewww). Matt > I like the implementation. This way if you have 2 browsers who can > share a style sheet you don't have to make one for "browser a" and one > for "browser b". I have a question though...does it still relative link > the style sheet or are you writing it to the {STYLE} variable as a > <style></style>? If you relative link to the file, most browsers seem > to read this file only once and cache it. But if it is included as a > <style> tag, the browser is forced to get this on every page hit. Might > be something to talk about? > > Adam > >> Greetings, >> >> There is new code in CVS to support multiple style sheets. Here is how >> it works. >> >> There is a new file in the theme named browsers.txt. It contains a >> listing of perl search strings and the appropiate style sheet to use. >> For example: >> >> Opera::opera.css >> MSIE 5.5::explorer.css >> Netscape6::netscape.css >> >> The first part before the double colons is the perl search (pretty >> basic in this example). Afterwards is the name of the style sheet to >> load INSTEAD of style.css if the search is TRUE. >> >> Layout then: >> 1) checks for the existance of the browser.txt file. >> 2) if true, layout reads the file and parses the list >> 3) if the browser is found AND if the style sheet exists, layout puts >> the address of the style sheet in the {STYLE} tag >> 4) if no conditions are met successfully and if style.css exists, the >> {STYLE} tag is set to the style.css address. >> 5) if none of the conditions are met, {STYLE} is never initialized. >> >> Note that I removed the <link> tag and it is now echoed along with the >> address. >> >> I could also add a parameter to the browser.txt files so that {STYLE} >> will echo the entire style sheet instead of merely linking to it. That >> would allow for preprocessing of the style sheet before it hits the >> theme. >> >> Let me know what you think and I will update the documentation if all >> is kewl. >> >> Thanks, >> Matt >> >> >> >> Matthew McNaney >> Internet Systems Architect >> Electronic Student Services >> Email: ma...@tu... >> URL: http://phpwebsite.appstate.edu >> Phone: 828-262-6493 >> ICQ: 141057403 >> >> >> >> >> ------------------------------------------------------- >> This sf.net email is sponsored by:ThinkGeek >> Welcome to geek heaven. >> http://thinkgeek.com/sf >> _______________________________________________ >> Phpwebsite-developers mailing list >> Php...@li... >> https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > > > --------------------------------- > Adam Morton > Developer - Web Technology Group > Appalachian State University > http://phpwebsite.appstate.edu > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers Matthew McNaney Internet Systems Architect Electronic Student Services Email: ma...@tu... URL: http://phpwebsite.appstate.edu Phone: 828-262-6493 ICQ: 141057403 |