📜 ⬆️ ⬇️

Hello, Umbraco!


This is not a saucepan with two handles on an orange background at all - but the Umbraco logo is an open-source ASP.NET CMS. This article is a short introductory course in Umbraco. In addition to general questions - what is it and why, I will show how you can quickly deploy it and make the first application in literally 5 minutes.

Umbraco is an open-source CMS written in ASP.NET / C #. Initially, it was developed by the Danish programmer Niels Hartvig 'for his projects, but now he has become quite adult and open-source. So what does the user - and the developer - Umbraco offer?
Let's start with the strengths:
1) This is open source. Umbraco uses a mixed license - MIT / Umbraco UI License. The second, in fact - the same MIT while maintaining the logos and brand Umbraco. There is also a commercial license - which includes support, a number of paid add-ons and allows CMS rebranding.
2) XML / XSLT / WebForms as a frontend - at first such an explicit emphasis on XML / XSLT seems unusual, but later comes the realization - how convenient it is.
3) Extensibility - a fairly convenient and flexible API for writing your own modules, complementing the functionality, data types, macros, etc.
4) Support for various databases - SQL Server, MySql, VistaDB (embedded DBMS, convenient for development).
5) Convenient Deployment Mechanism - Package System
6) Convenient interface for the administrator / editor
7) A large number of already created extensions, add-ons, data types, ready-made solutions based on Umbraco (eCommerce, blog-engines, etc)
8) Ability to use IronPython for developing extensions - for those who do not want to learn C # / VB.net
9) Active community - a lot of new projects, a “live” forum, a wiki, there are enough active bloggers.

However, it should be noted, and a number of things that sometimes cause inconvenience:
1) Some “randomness” of development - there is no clearly defined concept that would restrict the developer - accordingly, you need to constantly control yourself so that the project does not turn into a set of loosely coupled patches.
2) There is no strict and uniform documentation - as I said, there are a lot of sources - but often there is no specific address to find a solution with an obvious problem. However, the community responds quickly - and you can get an answer if you want. Well, in a pinch, there are always sources.
3) This is open-source - and for this you have to pay very often out-of-time errors. But - with the desire, community and source code - everything is repaired within a reasonable time.

To put you in mind that Umbraco is a serious enough thing, it is appropriate to bring large projects that use it - Peugeout.com, Heinz.com, Wired.co.uk, Hasselblad.com, sandisk.com, Denmark MSDN Community - msdncommunity .dk.
')
So, a lot of good has already been said - I think everyone will be impatient to try Umbraco in action. First we need the CMS itself - the latest version and source code is available at umbraco.codeplex.com . The current version is 4.0.3, but 4.1 is on the way. In version 4.1 - there are a lot of really cool changes - beta II is still available - but it is not recommended for production-use. The release is just around the corner - 2nd quarter 2010, in the meantime, for all examples we will use version 4.0.3. Download the archive with the latest version, unpack, create a new site in IIS and link it to the local address - I will use umbraco.local . You can create a database in MS SQL Server - but for development it is not necessary, it will be enough embedded DBMS VistaDB.

All these complicated and tedious steps can be avoided - using the Microsoft Web Platform Installer (http://www.microsoft.com/web/Downloads/platform.aspx). Find Umbraco CMS in the Content management list or simply click Install at www.microsoft.com/web/gallery/Umbraco%20CMS.aspx

Finally, the CMS is installed — go to the address umbraco.local in your favorite browser — and observe the Umbraco welcome page — with the installation suggestion. Installation includes a few simple steps - accepting a license (or not accepting - but then you can finish it), setting up a connection to the database, creating a database structure, setting an administrator password, checking file system permissions (read / write to the necessary directories). At the last stage, Umbraco will offer to install the Runway Foundation - a set of basic elements for building a site (text pages, navigation, FAQ, etc). We politely refuse - to keep the experiment clean.
After that, the actual CMS pages will be available - at umbraco.local you can watch a curious stub - indicating that there is nothing on the site yet and there is nothing to show (if we agreed to install Runway, we would immediately get a demo text page) and important - access to the admin panel - umbraco.local / umbraco / umbraco.aspx .



At the bottom left, there are sections available - admin sections, in which all the functionality is assembled. Section Content - contains the actual site tree - what will be available to the user. Media - allows you to upload pictures, flash, etc. Users - defines admin users, including grouping, assignment of access rights. Settings is one of the key sections, there are configured templates, scripts, CSS and - the cornerstone - document types (Document types). What is it - we will find out later. The Developer section gives access to package management, macros, data types and cache. Well, Members are users again, but this time the site itself (Umbraco also includes its Membership Provider).

Then I will show an approximate process of creating a page - without focusing on the details.
So, creating a page includes creating a Document type, creating a template for it, adding an element with the created document type to the Content tree, and publishing. First, create a Document type for the text page. Go to the Settings - Document type section, the context menu - Create ..., enter the name - TextPage and do not forget the Create matching template checkbox.



The creation is completed - and we see as many as 4 tabs with settings, but so far we are interested in the last 2 - Tabs and Generic properties. On the Tabs tab, add one Tab - let's call it Content. And in the Generic properties - add the PageText property with the type Richtext editor - and put it on the Content tab.



If something is not clear yet - then wait a couple of minutes, the clarification will come soon. Great, now there is a Document type - you can create content. We won’t touch the template yet - I’m too eager to see what our DocumentType looks like for the administrator.
Go to the Content section - and in the context menu of the root (Content) select Create .., specify our created Document type - and set the name - TestPage. OK - and now we see the world through the eyes of the site editor - in addition to the Properties tab (utility) - we see the Content tab and text editor created by us - into which you can enter the text of the first page. The name of the PageText property does not appear anywhere - but this is a requirement of the Richtext editor data type - it takes up all the available space.



Page created, filled - you can publish it. Just click Save and publish - and you can go to umbraco.local and enjoy the empty white page (instead of the message about the lack of content) - because the template for rendering our page has not yet been created. Okay, let's go back to the admin area, the Settings> Templates section - and open the automatically created TextPage template. I think the content of the template can alert you

<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %> < asp:Content ContentPlaceHolderID ="ContentPlaceHolderDefault" runat ="server" > </ asp:Content > * This source code was highlighted with Source Code Highlighter .
  1. <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %> < asp:Content ContentPlaceHolderID ="ContentPlaceHolderDefault" runat ="server" > </ asp:Content > * This source code was highlighted with Source Code Highlighter .
  2. <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %> < asp:Content ContentPlaceHolderID ="ContentPlaceHolderDefault" runat ="server" > </ asp:Content > * This source code was highlighted with Source Code Highlighter .
  3. <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %> < asp:Content ContentPlaceHolderID ="ContentPlaceHolderDefault" runat ="server" > </ asp:Content > * This source code was highlighted with Source Code Highlighter .
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %> < asp:Content ContentPlaceHolderID ="ContentPlaceHolderDefault" runat ="server" > </ asp:Content > * This source code was highlighted with Source Code Highlighter .


Yes, the premonition was not deceived - this is the usual ASP.NET MasterPage - with all the consequences (such as the ability to use WebForms + ASP.NET components, inherit pages, build a hierarchy of templates, write code behind) - in a word, like Komarov - “Oh, like all cooltoot! ”.
So, we are mentally preparing to write a bunch of C # code to display the text ... Early! Just click "Insert umbraco page field" on the toolbar - and select our pageText field.



<Umbraco: Item field = "pageText" runat = "server"> </ umbraco: Item> will be added to the template - and this is enough to display the text! Save the template, go back to umbraco.local - and voila - our text is now available to users. I note that our page is also available at umbraco.local / testpage.aspx - i.e. Umbraco manages the URLs of the site - and each page has a url = full path in the content tree (testpage subpages may have addresses - /testpage/subpage1.aspx, /testpage/subpage2.aspx - but this is a topic for a separate conversation).

Well, the simplest example is finished - all the goodies were left out - like working with content through XSLT, the document types hierarchy, templates, URL management - and much more. And accordingly, the question arises - will you be interested in reading a series of articles devoted to this CMS? Of course, it will not be just a translation of documentation - but a structured presentation from the roots to the very tips.

What else might be interesting:
umbraco.org - project site (there are training videos, documentation)
our.umbraco.org - community (wiki, forum, projects)
umbraco.codeplex.com - sources and new versions
en.wikibooks.org/wiki/Umbraco - some interesting articles
www.nibble.be - blog dedicated to Umbraco
twitter.com/umbraco - Twitter founder and maintainer - Niels Hartvig
twitter.com/alek_sys - twitter me)
Vasily K, Kirill Komarov - Krutototut - song in the mood.

Source: https://habr.com/ru/post/88533/


All Articles