MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Cannot clear theme assigned to page using the admin UI  (Mono Support )

Viewed 8499 time(s), 10 post(s) 10/24/2012 7:30:47 AMby GeorgeBirbilis13
GeorgeBirbilis13

GeorgeBirbilis13

10/24/2012 7:30:47 AM
It seems that when you use the admin UI you can't clear a theme assigned to a page (it has a blank entry at the dropdown but doesn't keep it when you save the settings edit)

Are those kept somewhere in the database?
This content has not been rated yet. 
211 Reputation 26 Total posts
GeorgeBirbilis13

GeorgeBirbilis13

10/24/2012 7:31:21 AM
Also has anyone managed to set a Theme globally for all pages via web.config? We can't make it work
This content has not been rated yet. 
211 Reputation 26 Total posts
denis

denis

10/24/2012 5:36:15 PM
There was a bug in the current version that prevented admins from clearing this value - it is fixed and will be available in the upgraded version. The value is kept in the Page table.
You can set a theme globally via web.config, but adding theme="..." in the pages element. Note that in that case you should clear the theme attribute from @Page directive on the individual page level, as it overrides this setting (as well as the value set in the page admin UI overrides it).
This content has not been rated yet. 
7207 Reputation 956 Total posts
GeorgeBirbilis14

GeorgeBirbilis14

10/25/2012 3:08:57 PM

thanks for the tip regarding web.config theme setting, I thought it would take precedence over page settings. To avoid editing all pages it would be nice if monox default site was using web.config setting instead of hardcoded values. Or it could have used the db setting

I want to minimize our page changes so that updating to new monox versions needs minimal actions

even a theme override in the db (one setting to rule all pages that don't have an explicit db entry for theme) would be nice and do the job

This content has not been rated yet. 
0 Reputation 1 Total posts
denis

denis

10/25/2012 5:41:56 PM
The overriding mechanism on the page level is implemented this way in ASP.NET, we did not change anything.
In any case, you mentioned on several occasions that you want to minimize page changes. While I don't have problems with this approach, it might indicate that there are implementation issues - your pages may be implemented in a way that do not interfere with further upgrades.
This content has not been rated yet. 
7207 Reputation 956 Total posts
ClipFlairadmin

ClipFlairadmin

10/26/2012 10:03:48 AM
I thought ASP.net only implements the web.config override and that the database override was you own implementation. Am I wrong at this?

If its yours you could add an override theme selection at the admin UI to override the theme for all pages that don't have an explicit theme override (set at the admin UI I mean). That would fit our needs, since it seems the admin UI (db) override of the theme applies OVER the page's hardcoded theme.

We now ended up using the DB override for the theme from the admin UI, but don't want to set it manually for all pages there. We want to tell the admin UI only once that we want a certain theme, not go into each page (if some page needed other theme we'd set only for that and would expect it to use that, but all the others use the theme override for the whole site). Obviously this is a feature suggestion for future versions, but I'm not sure from your writing above if the db theme override (available at the admin UI) is yours or some ASP.net standard (even if it's asp.net standard stuff, maybe the admin UI could have a shortcut then to change the theme for all pages in one step)
This content has not been rated yet. 
25 Reputation 4 Total posts
denis

denis

10/26/2012 10:11:45 AM
You are right about the database override, but the global and page (hardcoded) level theme behavior is inherited from ASP.NET. So there are basically three ways to set the theme - web.config, page and admin UI. If I don't get seomthing wrong, your scenario could be satisfied by using the global web.config setting and removing the hardcoded page theme. This way the theme set in the admin UI would apply only to the selected pages.
This content has not been rated yet. 
7207 Reputation 956 Total posts
GeorgeBirbilis15

GeorgeBirbilis15

10/26/2012 11:25:23 AM
The problem is that we have managed to have minimal changes in most of the portal pages and just work with the theme/template folders.

I want to be able to compare new versions of MonoX with the build we skinned and not see different files where I don't need to (e.g. just for the theme in the page header setting). I'd prefer those files to stay the same and not be shown to me by WinMerge tool (http://winmerge.org) or by version control

So I'd prefer to have the pages keep the Theme="Default" that they now have and not touch it. I hoped changing web.config would do the job, but seems the setting in the pages take precedence (pretty unfortunate design choice by Microsoft in my opinion)

So the db system you implemented suits me, if only there was a theme per-site override setting (in the db via the admin UI) that would override the hardcoded in the pages but NOT OVERRIDE any theme overrides set in the db via the admin UI for specific pages. That would be ideal (and very flexible in my opinion if you plan to implement a theme switcher in the future)...
...else, even having a shortcut action in the admin UI to set the theme for all pages in the db table in one step would be nice, since then for any pages that don't use our theme we'd go to them in the admin UI and set them to any other skin. Now we have to go to each page to set the theme in the admin UI and we may forget some, plus its tiresome and also we have to do it multiple times, e.g. on the designe/skinner's machine and on the production server (since I don't want to use the designer/skinner's test database but start with a new clean one on the production machine)
This content has not been rated yet. 
0 Reputation 2 Total posts
GeorgeBirbilis15

GeorgeBirbilis15

10/26/2012 11:42:29 AM
btw, if the demo site had that setting in web.config instead of hardcoded in the .aspx one would be able to change it easily for all pages and override any pages that need other theme via the admin UI (db override). I guess this would be the easiest for you to implement.

Then we'd be able to diff with new MonoX builds and not see files as changed since there wouldn't be any theme field in the @Page of .aspx files (see previous post)

Still the suggested enhancement to admin UI would be nice.
This content has not been rated yet. 
0 Reputation 2 Total posts
ClipFlairadmin4

ClipFlairadmin4

10/27/2012 9:46:12 PM
Thinking of it again, since the mobile pages are not grouped separately in the admin UI, setting a theme for all pages would affect them too which isn't desirable. Would need to go to each one of them and set some mobile theme then to override the theme db main override setting for the whole site that I suggested

Also if you remove hardcoded theme from all .aspx pages in future version and have your installer set their theme in the db, that would overrides any hardcoded theme in the pages that a designer may have set and make a skinned site non-functional when installed with a clean db and maybe the admin UI too inaccessible or hard to navigate to

Seems there's no easy way arround this, each option has its pros and cons
This content has not been rated yet. 
100 Reputation 16 Total posts