Additionally every web-site must have their own appSettings.
It looks like the optimal way to go is crating separated web.config files for every web-site and putting them in their folders like Umbraco\websites\site1\web.config, Umbraco\websites\site2\web.config, etc.
Unfortunately Umbraco doesn't pick up settings from the web.config files for the web-sites.
How can I make Umbraco to do it?
If it's not possible, what is the best way to implement my configuration?
Agree with Stephan, it could/would be much more easy/practical to get all application settings as properties on each top level node (which would represent a website), and let umbraco handle the multiple web part (don't forget to assign host headers to your top level nodes)
You can always get the current Node by accessing presentation.nodeFactory.Node.GetCurrent(), from there you can traverse the tree upwards and fetch those properties needed
OR
you could use a new instance of presentation.nodeFactory.Node(int pageId), if you know the ID of the root page.
You could also use umbraco.library.GetNodeFromLevel(string path, int level), where path is your node's @path attribute, i.e. "-1, nnnn, nnnn"
Separated web.config files in sub-domains
I'm trying to host multiple web-sites on a single Umbraco instance.
The sites are located in Umbraco\websites\site1, Umbraco\websites\site2, etc. folders. Every site has a set of Users with some privileges, like:
<authentication mode="Forms">
<forms name="yourAuthCookie" loginUrl="login.aspx" protection="All" path="/" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
...
<location path="admin.aspx" allowOverride="true">
<system.web>
<authorization>
<allow users="webSite1Admin" />
<deny users ="*" />
</authorization>
</system.web>
</location>
...
Additionally every web-site must have their own appSettings.
It looks like the optimal way to go is crating separated web.config files for every web-site and putting them in their folders like Umbraco\websites\site1\web.config, Umbraco\websites\site2\web.config, etc.
Unfortunately Umbraco doesn't pick up settings from the web.config files for the web-sites.
How can I make Umbraco to do it?
If it's not possible, what is the best way to implement my configuration?
What are the appsettings needed? Maybe you could implement them as properties on the site root nodes?
Agree with Stephan, it could/would be much more easy/practical to get all application settings as properties on each top level node (which would represent a website), and let umbraco handle the multiple web part (don't forget to assign host headers to your top level nodes)
Cheers,
/Dirk
You can try use location tag in web.config this way you can change SOME settings for subfolders
>What are the appsettings needed?
I have a bunch of my own controls and I wanted to keep some IDs and settings in the individual web.config files.
>Maybe you could implement them as properties on the site root nodes?
It sounds like a solutions if there is any way to get access to the properties from my own code.
Could you please give me some code example?
Thanks a lot for your help!
You can always get the current Node by accessing presentation.nodeFactory.Node.GetCurrent(), from there you can traverse the tree upwards and fetch those properties needed
OR
you could use a new instance of presentation.nodeFactory.Node(int pageId), if you know the ID of the root page.
You could also use umbraco.library.GetNodeFromLevel(string path, int level), where path is your node's @path attribute, i.e. "-1, nnnn, nnnn"
Good luck!
is working on a reply...