Skip to main content

Posts

Showing posts with the label Umbraco

ASP.MVC in Umbraco 6

Umbraco 6 brings new lots of improvements for developers, new datalayer, new API’s and complete support for Asp.net MVC 4. This means developers will have greater control, simpler code and higher productivity when developing with Umbraco. As the umbraco blog says, in Umbraco 6 we have: MVC support,  Native Razor support Strongly typed views   Building custom controllers Whole new shiny API Customizing routes. and many more.. Download the latest version 6.0.0. from http://umbraco.codeplex.com/releases . Create a blank MVC4 Application , and add the downloaded files to the newly created website. so that it will make the debugging easier. OR run NuGet Package Manager Command :  PM> Install-Package UmbracoCms Now we can enable the mvc in ~/config/umbracoSettings.config  <defaultRenderingEngine>Mvc</defaultRenderingEngine> by default it will be web forms change it to Mvc. Add another blank MVC4 project to the exist...

knockoutjs with Umbraco and Umbraco base call

I was thinking how we could use knockoutjs with Umbraco, so just thought blog it. Knockout is a JavaScript library that helps you to create rich, responsive display and editor user interfaces with a clean underlying data model. Any time you have sections of UI that update dynamically (e.g., changing depending on the user’s actions or when an external data source changes), KO can help you implement it more simply and maintainably. Features Elegant dependency tracking Declarative bindings Flexible and sophisticated templating Trivially extensible More information reference: http://knockoutjs.com . Well, we start with Umbraco, To know more on umbraco, Please refer below links http://our.umbraco.org/wiki/how-tos/a-complete-newbie's-guide-to-umbraco http://umbraco.com/help-and-support/video-tutorials/getting-started?freeVideos=1 http://our.umbraco.org/wiki/how-tos/getting-started-with-umbraco-what-is-next-after-you-install http://our.umbraco.org/wiki/install-and-set...

Localization in Umbraco, Item Page field localization

Umbraco is one of the most deployed Web Content Management Systems on the Microsoft stack. It's in the top five most popular server applications and among the ten most popular open source tools in general. You can directly download and start using it from http://www.umbraco.com If you have not used the application yet, its always worth trying it once. I am sure you will love it. Well, for the first time users, Umbraco provide step by step instruction for initial set up, once you are done you can use some sample template or create a blank website. To know more on umbraco, Please refer below links http://our.umbraco.org/wiki/how-tos/a-complete-newbie's-guide-to-umbraco http://umbraco.com/help-and-support/video-tutorials/getting-started?freeVideos=1 http://our.umbraco.org/wiki/how-tos/getting-started-with-umbraco-what-is-next-after-you-install http://our.umbraco.org/wiki/install-and-setup ,  I have created a blank website, Now we will go step by step. Fi...

Create Document Dynamically (Umbraco)

You can create document and publish the content during run time, Below code snippets helps you to do it. public class UmbracoUtils { /// <summary> /// Create and publish the document programatically /// </summary> /// <param name="nodeName"></param> /// <param name="properties"></param> /// <param name="documentType"></param> /// <param name="parentId"></param> /// <returns>node id</returns> public static int CreateDocument(string nodeName, Dictionary<string, string> properties, int documentType, int parentId, List<string> roles = null) { DocumentType dt = new DocumentType(documentType); umbraco.BusinessLogic.User u = new umbraco.BusinessLogic.User(0); // Create the document Document d = Document.MakeNew(nodeName, dt, u, parentId); // Add values...

Logger with UmbracoLog

Umbraco logger is powerful tool and It can be extended to use in your Umbraco application to log anything that you want to do, instead of using another logger to do the task. /// <summary> /// Logger to log Error/Debug/Warning to Umbraco log table /// </summary> public class Logger { public enum LogLevels { DEBUG = 1, WARNING = 2, ERROR = 3, NONE = 100 } public static LogLevels CurrentLevel { get; set; } private static string StrLoggedInUserId; public static void SetStrLoggedInUserId() { if (StrLoggedInUserId == null || StrLoggedInUserId == "NA") { if (HttpContext.Current != null) { HttpCookie cookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName]; if (cookie != null) ...