[Sputnik-list] Adding CSS/Javascript to a node

Jim Whitehead II jnwhiteh at gmail.com
Thu Mar 20 07:03:29 GMT+2 2008


On Thu, Mar 20, 2008 at 7:23 AM, Yuri Takhteyev <yuri at sims.berkeley.edu> wrote:
> >  node:add_css_url(url)
>  >  node:add_css_text(text)
>  >  node:add_script_url(type, url)
>  >  node:add_script_text(type, text)
>
>  This is close to what I was thinking but haven't gotten around to
>  doing.  The only difference is that I wanted to also have a way of
>  adding CSS and scripts through stored node fields (without exposing
>  those fields in the UI for regular users).  In most cases this would
>  remove the need to use node:add_css_url() in code.  If we do this, it
>  would make sense to move the CSS configuration into @Root:
>
>  css = [[
>     reset = {1, "node", "_yui_reset.css"}
>     layout = {2, "node", "_layout.css"}
>     custom = {3, "url", "http://www.../my.css"}
>     useless = {4, "inline", [[
>        .foo { display: none }
>     ]]}
>  ]]
>
>  This would later make it easy for you to turn off "useless" for your
>  forums, by setting useless=nil in your @Forums.
>
>  But the methods you are suggesting would be a good start.

I'll look at what is required to make these changes.

- Jim



More information about the Sputnik-list mailing list