Display my Custom MVC Page in Custom Section in Umbraco 7.2.1
Hi,
I am using Umbraco 7.2.1 version and trying to create a custom section and the custom section should display an Employee Listing Page which is created in MVC. I added below code in Global.ascx and inserted "EmployeeList" in umbracoUser2app table and I got the section available in Umbraco.
public class CreateContent : ApplicationEventHandler { protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { var sectionService = applicationContext.Services.SectionService; sectionService.MakeNew("EmployeeList", "EmployeeList", "awesome-icon", 10); } }
But how to display my Employee Listing page when I click on Employee Tab (I want something like below image when My custom tab is clicked.).
But as of now, when I click on EmployeeList tab I get a blank page. How do I map Employee Tab and my page. Is there any way I could do that
You might also be interested in the AngularJS Workbook https://github.com/umbraco/AngularWorkbook since chapter 5 describes how to add a custom tree to the "Settings" section and some code examples are on GitHub.
Ok thank you Dennis. I more quick question actually is it possible to have a custom section without tree structure.
I have a MVC page that I want to show in a custom section in Umbraco 7. I want to do this without having any tree within that section, as everything is already handled within the MVC page - It is being placed into the Umbraco back end for convenient access.
I would like to have like when the user clicks into the section, that MVC Page has to be shown.
Got an solution like this not sure how far it works but trying. The default view for a custom section in Umbraco 7 by adding a new section element to Dashboard.config as follows:
Hi I was just wondering if you ever got this working vinod?
I was looking at doing something similar and just displaying a list of items from the db in a grid on the right hand side. of the custom section's dashboard..
Display my Custom MVC Page in Custom Section in Umbraco 7.2.1
Hi,
I am using Umbraco 7.2.1 version and trying to create a custom section and the custom section should display an Employee Listing Page which is created in MVC. I added below code in Global.ascx and inserted "EmployeeList" in umbracoUser2app table and I got the section available in Umbraco.
public class CreateContent : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
var sectionService = applicationContext.Services.SectionService;
sectionService.MakeNew("EmployeeList", "EmployeeList", "awesome-icon", 10);
}
}
But how to display my Employee Listing page when I click on Employee Tab (I want something like below image when My custom tab is clicked.).
But as of now, when I click on EmployeeList tab I get a blank page. How do I map Employee Tab and my page. Is there any way I could do that
Hi Vinod,
There are some good blog post about how to create a new section a good starting point could be the blog posts from Markus Johansson http://www.enkelmedia.se/blogg/2013/11/22/creating-custom-sections-in-umbraco-7-part-1.aspx
http://www.enkelmedia.se/blogg/2013/11/22/custom-sections-in-umbraco-7-%E2%80%93-part-2-the-views.aspx
And you can find more about sections and trees in the official Umbraco documentation here http://our.umbraco.org/documentation/Extending-Umbraco/Section-Trees/ and Tim Geysens have made a nice walkthrough blogpost on his blog http://www.nibble.be/?p=440
You might also be interested in the AngularJS Workbook https://github.com/umbraco/AngularWorkbook since chapter 5 describes how to add a custom tree to the "Settings" section and some code examples are on GitHub.
Hope this helps,
/Dennis
Hi,
Ok thank you Dennis. I more quick question actually is it possible to have a custom section without tree structure.
I have a MVC page that I want to show in a custom section in Umbraco 7. I want to do this without having any tree within that section, as everything is already handled within the MVC page - It is being placed into the Umbraco back end for convenient access.
I would like to have like when the user clicks into the section, that MVC Page has to be shown.
Hi Vinod,
I donĀ“t think it possible for you to a have custom section without tree structure. But what I think you can do is to make the tree structure into a list view. Try to see this blog post about the list view http://www.robertgray.net.au/posts/a-first-look-at-umbraco-container-content-types#.VOGYZS5G_Ik
Hope this helps,
/Dennis
Got an solution like this not sure how far it works but trying. The default view for a custom section in Umbraco 7 by adding a new section element to Dashboard.config as follows:
where the
<area>
element must contain the alias of your custom section, all in lower case.The
<control>
element contains the path of the default html file.And also if its an MVC Page, how will it work. Doing an analysis.
Hi I was just wondering if you ever got this working vinod?
I was looking at doing something similar and just displaying a list of items from the db in a grid on the right hand side. of the custom section's dashboard..
is working on a reply...