Angular2 sub directory of umbraco - asp.net-mvc

I have an umbraco application. I want to integrate angular2 sub directory as a part of umbraco application. If some one type UmbracoURL/Inventory, I want to show angular2 Inventory application. Can any one provide me a solution please...?

Is the Angular2 app a single page app? In that case you can integrate it as part of the Umbraco application.
You'll need to create a template in Umbraco with you Angular2 application, perhaps introduce a new documenttype called Inventory? Then create a new node called Inventory at root level in the Content tree, set the template to new Inventory template. And you should be able to access the angular2 app through the /inventory url.
If you want to use the content of a physical directory in Umbraco, you'll probably have to change the Umbraco/MVC routing

Related

Umbraco template not being created from new MVC View in existing application

I have an existing project that is running Umbraco 7.10
Whenever we create a new view, the template is not created in Umbraco (but new Partials are) when we deploy to existing environments
We are not using uSync at present and the umbracoSettings.config template section is set to Mvc rather than WebForms
What is stopping the template being present in Umbraco? is it something I am missing in the cmsTemplate table?
Many thanks
You need to create the template in Umbraco and then manually include in your VS project not the other way around.
There is a db component to a template/view which only gets created if you do things from Umbraco rather than VS. Partials do not have a db component and are simply read from the file system.
uSync would be a good move if you have separate databases for different environments otherwise you will have to add the template to each Umbraco instance.

having multiple mvc projects under same url

I was wondering if it's possible to create an mvc project with layers inside or even multiple projects using the same web address.
Like if I have a website called mysite.com which have a website project doing sine stuff.
But then I have a webproject which I'm doing some experimentational code on which I whould like to find via the url "mysite.com/test". This whold be a dufferent mvc project. Is that even possible?
It is possible, what you actually need to is create a new project and define it inside a virtual directory.
MVC is based on global.asax and web.config configurations and you can't have 2 separate projects inside the same application. In the scenario you described, it sounds like you need to create a "Virtual Directory" in IIS for the second application instead of making just a "Sub Folder".
The Virtual Directory will allow you to declare a new web.config and global.asax where you set the new routings and configurations method for your second application and this will also give you the freedom for independent updates without affecting your main project.
For a full walkthrough on how you can perform this please refer to this site:
http://msdn.microsoft.com/en-us/library/vstudio/bb763173(v=vs.100).aspx

Umbraco: creating user control

I'm new to Umbraco. Currently is using v7.1.4.
I know that MVC partial views can be created under Settings > Partial Views.
If I have switch the rendering engine from MVC to webforms, where should I create .Net user control?
Just to add to CMayers answer, i generally prefer to create a separate project called usercontrols (just for the sake of knowing what it is) and then using xcopy in the build event copy the dll to the bin folder of the umbraco installation. Likewise the ascx pages are copied into the UserControls folder of the umbraco installation.
Then from the umbraco backend in the developer section, you can create the macro and associate the relevant ascx page to it.
All your .NET Usercontrols should be created in the 'UserControls' folder that comes with the default Umbraco installation.
If you don't copy them to here, then you wont be able to access your user controls from the Macro section of the CMS "Choose a file to render".

Sub application in Umbraco

Currently I have a website built with Umbraco 4.9.
What are the options to have a sub application (pure MVC 4 preferably) running under Umbraco infrastructure?
The idea is to have a custom app with custom database and custom logic. The only integration points would be:
common user base (authentication)
access to Umbraco's dictionaries from custom app
share same session, that is if user is navigating through pages in
custom app his session should not expire for website
have custom app
under same domain (www.mysite.com for website and www.mysite.com/app
for app)
Thanks in advance
I'm not too familiar with v4.0.9, but I imagine its somewhat similar to 4.7. If that's the case, you should be fine to place your sub application inside the folder structure of your existing umrbaco instance. In IIS, you will need to convert the subfolder into an application. Within the web.config of your umbraco instance, you will need to add the path to your sub app in the umbracoReservedPaths app setting.
I'm not sure how session would here. I believe the asp.net membership should work fine. By adding references to the Umbraco dll's in your mvc project you should be able to access the Umbraco dictionaries fine.

Using Application Pages for List Forms

I'd like to use an application page that I created in the _layouts folder as the new document form for a document library in SharePoint.
When I attempt to do this in SharePoint Designer, I have to browse to the file but it doesn't let me browse to the _layouts folder.
This functionality will be list specific so is there a way to make this connection on a per-list basis? My only idea right now is to use a redirect page.

Resources