Esempio n. 1
0
        /// <summary>
        /// Creates a post and returns it.
        /// </summary>
        /// <param name="documentId"></param>
        /// <returns></returns>
        public IContent CreatePost(int documentId, string title)
        {
            // create the node
            var content = IContentHelper.CreateContentNode(title, "uBlogsyPost", new Dictionary <string, object>(), documentId, false);

            // this is a hack because there is a bug in Umbraco 6 which means datefolders is not being fired.
            ApplicationContext.Current.Services.ContentService.Save(content);
            return(content);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a uBlogsyPost Document
        /// </summary>
        /// <param name="item"></param>
        /// <param name="parentId"></param>
        /// <returns></returns>
        private IContent CreatePost(RssItem item, int parentId)
        {
            // create post item
            var postDic = new Dictionary <string, object>()
            {
                { "uBlogsyPostDate", item.Date },
                { "uBlogsyPostAuthor", TxtAuthor.Text },
                { "uBlogsyContentBody", item.Description },
                { "uBlogsyContentTitle", item.Title }
            };

            return(IContentHelper.CreateContentNode(item.Title, "uBlogsyPost", postDic, parentId, false));
        }