How to obtain site ID
Hello,
I am working with SiteFinity 6.0, and have currently established two (2) sites. Each site represents a unique big-picture entity, each of which is already established and lives in a separate database table. I need to create a table that allows me to map each SiteFinity site with one of these entities. My question is how can I obtain the site ID of the site I am currently viewing from a code behind of one of my custom controls? This would obviously be needed to query information from that table.
Also, possibly looking at this from another angle, is there any way to create a site in SiteFinity and apply settings to it? In this case, I could establish a site and simply give it a few key/value settings (e.x. RemoteEntityId -> 34).
Any help is greatly appreciated.
I found the answer to my problem. You can access the current site as follows:
var currentSite = new Telerik.Sitefinity.Multisite.MultisiteContext().CurrentSite;
Hello,
Each site in the multisite setup stores only the site related information like site ID, name, domain, etc tough its not a type that can store custom data as the dictionary you refer to. An option is to store the additional properties in a module available only in specific site or in database tables created only for the purpose to save this information. Let me know what properties you want to save and in what is the result to be achieved to see if this can be achieved in other way.
Regards,
Stanislav Velikov
Telerik