views:

256

answers:

3

I am currently using the ui-lightness theme in my Zend Framework application but I would like to use both for different things. I'm currently registering the ui-lightness theme with this line in my bootstrap:

$view->headLink()->appendStylesheet($view->baseUrl().'/js/jquery/css/ui-lightness/jquery-ui-1.7.2.custom.css');

How can I add another theme to use? How will the application know which theme to use if I add another stylesheet?

A: 

I don't think you can use two themes on the same page out of the box with jQuery UI. Each jQuery UI theme styles all widgets, not just specific ones.

You could, create your own stylesheets to style widgets individually. Or, if you don't want different themes on a single page, just include the different themes on different pages.

smack0007
+2  A: 

You can do this using CSS scope. When you build your theme on the jQuery UI site choose Advanced Settings and then enter in name in the scope field.

Do the same with whatever other themes you want to use, making sure that the scope is unique for each one.

Include the CSS theme files as normal (using appendStylesheet) and use the scope classes to style each area/item on the page

A styled example is given here

Shane O'Grady
I sort of gave up on attempting this, but I think you have the right answer.
Andrew
A: 

If you want different jQuery UI themes on different pages of your application, you can use Zend_Layout to switch layouts on different pages of your application. Each layout can use a different jQuery UI theme.

asgeo1
no I want to use two different jQuery UI Themes on the same page for different things.
Andrew