Primary links

Skinning in ActiveGrid

For one project we'd like to have a dynamically configurable stylesheet where the stylesheet that is returned to the client depends on the name of the database from the deployment.

Any cool ideas on how to do this? Should we create a JavaScript hack to do this, or is there a smarter way.

Eljakim

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gcohen's picture

Out of the box, we dont

Out of the box, we dont support this, but have you discovered a way to do it?

Just a hint!!!

This is not a complete solution but an idea, that may help in developing a solution

(or may just prove to be a wrong way :D  and then can be used to tell ppl ... not to think of this approach ;) )

This issues is certainly an interesting case. It reminded me of a system in which we just copied different css files in a folder. Then the HTML page header was generated dynamically using server side script. The required css file name was switched according to some setting from db. I hope something like this can help here.

While I started looking at things to implement something similar in AG application, I found out that

1- Our page headers are generated dynamically (good).

2- Out styleSheet is included dynamicaly in header (good).

3- We can use the MasterLayout.lyt to modify the layout of master file and if we succesfuly do that ... our style switching (skinning, or css swithing ) would be done for whole site (good).

4- I found out that line 38 of masterLayout.lyt file contains this code

 

 <Link rel="stylesheet" type="text/css" media="all" href="<%= item.resolveStaticURL('$SiteColorCSS') %>" />     ... well I can see the variable $siteColorCss is the key here. If we can switch values in this variable based on some custom logic, we can implement the same approach as i have mentioned above.

5- I have seen that this variable gets changed when we add a Custom Css on bpel page. Our specified css file is set in this variable.

Now the things to explore are ...

1- can a developer change this variable using some custom code?

2- What would be the appropriate point where this code should be placed?

Well another thing to explore is .. can we add some JS to the same layout file to include our css after the detault css is added ? this can also help.

Sorry for open question in this message, but i wanted to share this idea. I hope someone can do this before me, who has a better understanding of AG than me ;)

Or perhaps geremy can give a hint and we can get ahead relatively easily.

 

Thanks

Faisal