How to load my own CSS files...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

How to load my own CSS files...

Rick Flower
I've got some hand-coded css files I'd like to use (as opposed to
embedding them in my Seaside image), but can't seem to get linkToStyle:
working for some reason.. Has anyone tried using this before and if so
provide an example?  Thanks!

-- Rick

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to load my own CSS files...

Philippe Marschall
2006/3/4, Rick Flower <[hidden email]>:
> I've got some hand-coded css files I'd like to use (as opposed to
> embedding them in my Seaside image), but can't seem to get linkToStyle:
> working for some reason.. Has anyone tried using this before and if so
> provide an example?  Thanks!

Are you doing this in an #updateRoot: method (don't forget super) or a
#renderXXXOn: method? You should do this in the first.

Philippe
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to load my own CSS files...

Rick Flower
Philippe Marschall wrote:

> 2006/3/4, Rick Flower <[hidden email]>:
>  
>> I've got some hand-coded css files I'd like to use (as opposed to
>> embedding them in my Seaside image), but can't seem to get linkToStyle:
>> working for some reason.. Has anyone tried using this before and if so
>> provide an example?  Thanks!
>>    
>
> Are you doing this in an #updateRoot: method (don't forget super) or a
> #renderXXXOn: method? You should do this in the first.
>  
For the time being, since I couldn't figure out how to do it, I just
cut-n-pasted the contents of my css files
into my top-level style method, which achieves the same goal, but is not
really what I'd like to do overall.
Do you have an example of what I need to do in order to make this work?  
Thanks!

P.S. In my case, I was doing it in a render block.


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to load my own CSS files...

Philippe Marschall
> For the time being, since I couldn't figure out how to do it, I just
> cut-n-pasted the contents of my css files
> into my top-level style method, which achieves the same goal, but is not
> really what I'd like to do overall.
> Do you have an example of what I need to do in order to make this work?
> Thanks!
>
> P.S. In my case, I was doing it in a render block.

You should not do in a normal render method but an #updateRoot:

MyComponent>>#updateRoot: aHtmlRoot
        super updateRoot: aHtmlRoot.
        aHtmlRoot linkToStyle: '/include/style/menu.css'.
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to load my own CSS files...

Rick Flower
Philippe Marschall wrote:
> You should not do in a normal render method but an #updateRoot:
>
> MyComponent>>#updateRoot: aHtmlRoot
> super updateRoot: aHtmlRoot.
> aHtmlRoot linkToStyle: '/include/style/menu.css'
Thanks Philippe..   Can I assume that the above code is good for either
old school rendering or the new Canvas
rendering as well?

Thanks again!

-- Rick

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to load my own CSS files...

Philippe Marschall
> Can I assume that the above code is good for either
> old school rendering or the new Canvas
> rendering as well?
Yes because  aHtmlRoot is an instance of WAHtmlRoot and not
WAHtmlRenderer or WARenderCanvas.

Cheers
Philippe
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to load my own CSS files...

Michel Bany-3
In reply to this post by Rick Flower
Rick Flower a écrit :

> For the time being, since I couldn't figure out how to do it, I just
> cut-n-pasted the contents of my css files
> into my top-level style method, which achieves the same goal, but is
> not really what I'd like to do overall.


Still, I see a big benefit in having the css stylesheets implemented as
Smalltalk code.
The versions of the css stylesheets and the version of the code are
guaranteed to be in synch.
Did you consider using style libraries ?

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to load my own CSS files...

Rick Flower
Michel Bany wrote:

> Rick Flower a écrit :
>> For the time being, since I couldn't figure out how to do it, I just
>> cut-n-pasted the contents of my css files
>> into my top-level style method, which achieves the same goal, but is
>> not really what I'd like to do overall.
>
>
> Still, I see a big benefit in having the css stylesheets implemented
> as Smalltalk code.
> The versions of the css stylesheets and the version of the code are
> guaranteed to be in synch.
> Did you consider using style libraries ?
No.. Can you elaborate what a style library is?  I think one of the
reasons I like to modify my stylesheets
as an external entity from the Seaside environment is that it's easier
and frequently nicer to use a CSS
editor to see in realtime what sorts the settings will look like without
using the browser.  However, I'm
intrigued by the concept of a library of styles.. I'm open to using
something new and thinking about
things in a different manner -- that's how I stumbled across Seaside &
Smalltalk and now have the
entire front-end of my application running in no short order!

-- Rick


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to load my own CSS files...

Michel Bany-3

On 06 Mar 2006, at 23:31 , Rick Flower wrote:

> Michel Bany wrote:
>> Rick Flower a écrit :
>>> For the time being, since I couldn't figure out how to do it, I  
>>> just cut-n-pasted the contents of my css files
>>> into my top-level style method, which achieves the same goal, but  
>>> is not really what I'd like to do overall.
>>
>>
>> Still, I see a big benefit in having the css stylesheets  
>> implemented as Smalltalk code.
>> The versions of the css stylesheets and the version of the code  
>> are guaranteed to be in synch.
>> Did you consider using style libraries ?
> No.. Can you elaborate what a style library is?

A style library is a subclass of WAStyleLibrary where each instance  
method answers a css stylesheet.
WAStandardStyles can be used as an example. Note that you also have  
WAScriptLibrary
subclasses for Javascript libraries.

You relate your application to one or more style libraries using the  
Seaside config tool.
Or you can do it programmatically in the #initialize method

        initialize
                | app |
                app := self registerAsApplication: 'foo'.
                app  libraries add: MyFirstStyleLibrary.
                app  libraries add: MySecondStyleLibrary.
                app libraries add: MyJavascripts.


>   I think one of the reasons I like to modify my stylesheets
> as an external entity from the Seaside environment is that it's  
> easier and frequently nicer to use a CSS
> editor to see in realtime what sorts the settings will look like  
> without using the browser.  However, I'm
> intrigued by the concept of a library of styles.. I'm open to using  
> something new and thinking about
> things in a different manner -- that's how I stumbled across  
> Seaside & Smalltalk and now have the
> entire front-end of my application running in no short order!
>

I agree that you should use a CSS editor (like Xyle) for helping you  
building the stylesheets. I am only
suggesting that the stylesheets should be stored into style libraries  
and served from there. The only tricky
issue is how you store the stylesheets into the Smalltalk image. Copy/
paste is one way. FTP is another way
See
http://www.cincomsmalltalk.com/userblogs/avi/blogView?
showComments=true&entry=3303394043
or
http://lists.squeakfoundation.org/pipermail/seaside/2006-February/ 
006726.html

HTH,
Michel.

> -- Rick
>
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside