hii guys i want some tips to carry on umbraco web api in my website. example i want to create an about us or blog page as an api in my site so how can i render the data from content node to the web api controller. Can you suggest how the data entered in the content node can be used by api in the controller file. can you suggest any code snippets which i can use to return the data of some already created page in website to use in controller file.
yes i have gone through those documentation but i dont now how those pages which are published i can use it in api and render those values in the api controller
what i am doing is going through some custom work and this is purely for learning purpose, so i am going through series of components which are used in umbraco and practically implement it in my website. i want to learn how i can implement umbraco api on my already built pages, lets say About us/blogs page, i have those page and i want to built an api used to display the data which is stored in the content area of the same . so how can i achieve this?? I may sound a bit inexperienced but i am very much interested in learning this things. Sorry in advance for my silly doubts.😇
I have seen the documentation but i want some syntax or code snippets for the same, how to retrieve the umbraco content nodes data into an umbracoapi controller. can you please help me out i am stuck into this and cant find any proper solution. if possible can you give some code snippets regarding my topic of concern?? it will be great help. thanx in advance
i have an blog section and want to create umbraco api for the same, i have an running blog section in my website now i want to use api for the same. below i am giving an example of how my blog code is:
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Houseroo1.Models
{
public class BlogsArticleModel
{
public string Title { get; set; }
public string Intro { get; set; }
public string Url { get; set; }
public DateTime ArticleDate { get; set; }
}
}
And this is the controller of the same :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Umbraco.Web.Mvc;
using System.Web.Mvc;
using Houseroo1.Models;
using Umbraco.Core.Models;
using Umbraco.Web;
using Houseroo1.Extensions;
namespace Houseroo1.Controllers
{
public class BlogsController : SurfaceController
{
public string GetViewPath(string name)
{
return $"/Views/Partials/HomeContent/{name}.cshtml";
}
can you help me how to create an api controller for the same. can you advice me some syntax or code snippets from where i can know how its done.
also i saw a article here but in this the data is been used in normal controller "https://our.umbraco.com/forum/developers/api-questions/29127-Getting-data-from-umbraco-inside-a-controller" i want it in umbracoapi so how can it be done?
actually i am pretty much newbie so dont know how to carry on api in here. i want to create an umbraco api for the blogs in which i can perform the task and also i can retrieve the already created blogs in backoffice. as seen below in figure.i am working on sample website which is purely for learning basis
umbraco web api
hii guys i want some tips to carry on umbraco web api in my website. example i want to create an about us or blog page as an api in my site so how can i render the data from content node to the web api controller. Can you suggest how the data entered in the content node can be used by api in the controller file. can you suggest any code snippets which i can use to return the data of some already created page in website to use in controller file.
Hi Ishan did you check the umbraco web api documentation?
yes i have gone through those documentation but i dont now how those pages which are published i can use it in api and render those values in the api controller
Show me your controller code and your model if you have? Simplify it if it's too complicated please.
what i am doing is going through some custom work and this is purely for learning purpose, so i am going through series of components which are used in umbraco and practically implement it in my website. i want to learn how i can implement umbraco api on my already built pages, lets say About us/blogs page, i have those page and i want to built an api used to display the data which is stored in the content area of the same . so how can i achieve this?? I may sound a bit inexperienced but i am very much interested in learning this things. Sorry in advance for my silly doubts.😇
This shows you how to implement an API controller for Umbraco:
https://our.umbraco.com/documentation/reference/routing/webapi/
However, if you're just looking to get content nodes from umbraco you could use surface controllers.
Without seeing any code I can't exactly pinpoint what you want to do, but I think the links help a lot.
I have seen the documentation but i want some syntax or code snippets for the same, how to retrieve the umbraco content nodes data into an umbracoapi controller. can you please help me out i am stuck into this and cant find any proper solution. if possible can you give some code snippets regarding my topic of concern?? it will be great help. thanx in advance
i have an blog section and want to create umbraco api for the same, i have an running blog section in my website now i want to use api for the same. below i am giving an example of how my blog code is:
`@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ Layout = "Webbase.cshtml"; }
below is model for the same
using System.Collections.Generic; using System.Linq; using System.Web;
namespace Houseroo1.Models { public class BlogsArticleModel { public string Title { get; set; } public string Intro { get; set; } public string Url { get; set; } public DateTime ArticleDate { get; set; }
}
And this is the controller of the same :
using System.Collections.Generic; using System.Linq; using System.Web; using Umbraco.Web.Mvc; using System.Web.Mvc; using Houseroo1.Models; using Umbraco.Core.Models; using Umbraco.Web; using Houseroo1.Extensions;
namespace Houseroo1.Controllers { public class BlogsController : SurfaceController { public string GetViewPath(string name) { return $"/Views/Partials/HomeContent/{name}.cshtml"; }
}
can you help me how to create an api controller for the same. can you advice me some syntax or code snippets from where i can know how its done.
also i saw a article here but in this the data is been used in normal controller "https://our.umbraco.com/forum/developers/api-questions/29127-Getting-data-from-umbraco-inside-a-controller" i want it in umbracoapi so how can it be done?
Sorry man, would you mind formatting the controller correctly? i can't read it like this.
sorry for the formatting
actually i am pretty much newbie so dont know how to carry on api in here. i want to create an umbraco api for the blogs in which i can perform the task and also i can retrieve the already created blogs in backoffice. as seen below in figure.i am working on sample website which is purely for learning basis
is working on a reply...