TAG: icontentservice

Software Engineer. Stuff and nonsense. The usually short ramblings of Chris McKee.

Dear Umbraco… I Can Haz Content?!

Basic mission; code not my own. Create an advert type; consisting of URL and Image. Additional requirement created setting the type of advert (using uComponents) An AdvertContainer (Doc Type) With two 'types' of advert (i.e. 3rdparty/mpu) ThirdParty contains JS (no image/URL) MPU contains Image/URL var nodes = GetMultiNodeSelection(1101, "adverts"); Foists off into some god awful linq abuse… private IEnumerable<IContent> GetMultiNodeSelection(int id, string property) { var node = _contentService.GetById(id)…

Using Umbraco Content Service outside of Umbraco context/control in Umbraco 6

In order to make user of IContentService outside of Umbraco Controllers/Views/etc you're going to need to expose it. Much in the same way you'd setup NHibernate to create a session factory on application start we grab IContentService and make it accessible. In this case via UmbracoApplication.UmbContentService UmbracoApplication.cs namespace XXX.UI { using System.Web.Http; using System.Web.Mvc; using System.Web.Routing; using Umbraco.Core; using Umbraco.Core.Services; public class UmbracoApplication…