A Question on Site Settings

Topics: Customizing Orchard
Oct 2, 2012 at 6:09 PM

Hi Folks,

I'm looking to add a series of site settings that need to be on a per-tenant basis. I've reviewed the material in http://docs.orchardproject.net/Documentation/Adding-custom-settings, but I would like to provide my settings via my own admin screens (using controllers marked with [Admin] ).

My question is: can I attach my settings to site settings, but only show/edit these settings from my custom screen, and not from the normal settings screen. I think if I provide no html in the edit view this might work, but it doesn't seem the correct way to do this.

Is there a better way to achieve this?

cheers,

Paul

Coordinator
Oct 3, 2012 at 12:57 AM

Sure. All data is tenant-specific. You can create your own type and make only one item of that. You can manage it entirely yourself.

Oct 3, 2012 at 9:21 AM

Thanks Bertrand - I presume that this would appear in the "content" section. Is there anyway to hide content items from the default list?

Oct 3, 2012 at 3:43 PM

Ok, my situation is a little more complex than I first thought.

The setting I would like to change is the URL to the authentication web services (which replaces the default Orchard IMembershipService). This setting is used as the start of the URL for all my service calls

Unfortunately, it appears that the content manager checks for the current user, which requires a check to the membership service to see if you can access the content. Unfortunately, as the content is the the url for the membership service, the code gets stuck in a loop.

Is there a way to run code in an "Escalated Privileges" mode, that is, get a content item outside the context of the current user?

cheers,

 

Paul

Coordinator
Oct 3, 2012 at 5:27 PM

If you don't make the type creatable it won't appear in the list, but you'll still be able to manage it through your own custom screens.

You may want to store those settings in a custom config file that you can read without content manager, to bootstrap things.