Thursday 8 March 2018

How to use Content Service API in Umbraco CMS Systems



Umbraco is open source Content Management System ( CMS ) for overseeing dynamic content on any site. It is overseeing content from administrator board and show on the front side. It is anything but difficult to make content from administrator board. At times we have to make content from a front side. For instance, we have to spare tributes for the site then it will be submitted from a front side. For this situation, we have to spare content from the front end. Umbraco CMS additionally give us Content Service API to oversee content. We can utilize that content benefit API to make content from front-end side.


There are a few stages to make content utilizing Content Service API.

  • Make surface Controller. 
  • Include a strategy for making content. 
  • Set non-specific properties of the substance. 
  • Include a strategy in Umbraco shape. 

>> Best iOS App Development Company


For Example, If we have to include tributes information in our site at that point, First of all, we have to make Surface Controller in Umbraco CMS project. At that point, we have to add technique as underneath to include tribute information in Umbraco CMS site. We have to set the estimation of non-specific properties which we had characterized while making record kind of tributes.

public ActionResult AddTestimonial(string Name = "", string Description = "")
{
var contentService = new ContentService();
var user = contentService.CreateContent(
Name, // Node Name - what I want to call the new child node
1115, // Parent Node we want to add to
"umbTestimonial", // The alias of the Document Type
0); // Umbraco User ID this will be created by, default 0
user.SetValue("name", Name);
user.SetValue("description", Description);
contentService.SaveAndPublish(user);
return this.Redirect("/testimonial-list");
}

Now, We can post the data using BeginUmbracoForm method of Umbraco CMS system.


@using (Html.BeginUmbracoForm("AddTestimonial", "TestimonialSurface", FormMethod.Post))
{
//add your form code here
}

I trust that this article will make your Umbraco CMS integration as simple as. connect, in the event that you might want to help in Umbraco CMS development. You may likewise Hire Umbraco CMS Developers from our organization for Help and Supports.

2 comments:

  1. Kentico 13 xperience upgrade A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post.

    ReplyDelete

Twilio Programmable Wireless Moves from Beta to General Availability

Twilio has declared that Programmable Wireless is currently out of beta and by and large accessible (GA). Twilio Programmable Wireless ...