How can I access a new Site content?

Topics: General
Apr 9, 2013 at 5:17 AM
After I created a new content from a Site content type.
Developer
Apr 9, 2013 at 11:00 AM
If I understand correctly you created a content item of type Site. The Site content type's single item stores site settings. Why have you created another item of it by hand?
Apr 9, 2013 at 3:57 PM
Piedone wrote:
If I understand correctly you created a content item of type Site. The Site content type's single item stores site settings. Why have you created another item of it by hand?
I am about to use a new Site content which I just created, I already have one. I didn't mean to create another one Site content item.
Developer
Apr 9, 2013 at 5:27 PM
The question is: why create a new Site content yourself when there is already a Site content item available to you via IOrchardServices or WorkContext?
Apr 10, 2013 at 2:29 AM
sfmskywalker wrote:
The question is: why create a new Site content yourself when there is already a Site content item available to you via IOrchardServices or WorkContext?
How to use an existing Site content via IOrchardServices or WorkContext?
Developer
Apr 10, 2013 at 8:34 AM
// Inject IOrchardServices via the constructor and store it in _orchardServices.

var site = _orchardServices.WorkContext.CurrentSite;  // This is the Site content item.