0% found this document useful (0 votes)
349 views19 pages

Training On Umbraco - Part II

The document outlines an agenda and goals for a day 2 Umbraco CMS training which includes building a simple site, understanding core topics like nodes, documents, media, forms, data editors, and search functionality. It provides details on setting up SEO friendly URLs and meta tags. It also describes extending Umbraco through user control wrappers and abstract data editors, and using the content and media APIs with Razor and user controls. Events and the Examine search engine are also overviewed.

Uploaded by

shaishavkarnani
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
349 views19 pages

Training On Umbraco - Part II

The document outlines an agenda and goals for a day 2 Umbraco CMS training which includes building a simple site, understanding core topics like nodes, documents, media, forms, data editors, and search functionality. It provides details on setting up SEO friendly URLs and meta tags. It also describes extending Umbraco through user control wrappers and abstract data editors, and using the content and media APIs with Razor and user controls. Events and the Examine search engine are also overviewed.

Uploaded by

shaishavkarnani
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Training on Umbraco CMS

Prepared by Shaishav Karnani

Agenda for Day 2


BUILDING A SITE (PRACTICAL) SEO FRIENDLY SITE NODE, DYNAMICNODE, DOCUMENT, CONTENT & MEDIA API FORMS ADVANCED DATA TYPES DATA EDITORS EVENTS EXAMINE/SEARCH

Goals of Day 2

Build simple website

Understanding of different topics on Umbraco CMS

BUILDING A SITE (PRACTICAL)

Basic Structure

Site Navigation
Home Page Text Page News & Events Handling Images & Gallery

SEO FRIENDLY SITE


SEO URL

Meta Tags
Other SEO features that can be optimized for the site

Site Map Package

Robot.txt editor package


User Friendly URLs

Node

using umbraco.NodeFactory;

// Fetch Nodes Node node = Node.GetCurrent(); Node node = new Node(id);

idrow2.Text = node.GetProperty("introText1").Value;
//Fetch Child Nodes var childNodes = node.Children; foreach (Node childNode in childNodes) { Response.Write(string.Format("{0}<br />", childNode.Name)); } //Fetch Media var mediaItem = umbraco.cms.businesslogic.media.Media(id) imageurl = mediaItem.getProperty("umbracoFile").Value.ToString();

Document
using umbraco.BusinessLogic; using umbraco.cms.businesslogic.web; Creating a Document //Get the type you would like to use by its alias DocumentType dt = DocumentType.GetByAlias("Textpage"); User author = User.GetUser(0);

//create a document with a name, a type, an umbraco user, and the ID of the document's parent page.
Document doc = Document.MakeNew("My new document", dt, author, 1018); //after creating the document, prepare it for publishing doc.Publish(author); //Tell umbraco to publish the document umbraco.library.UpdateDocumentCache(doc.Id);

Updating a Document
// Get the document by its ID Document doc = new Document(1029);

// Get the properties you wish to modify by it's alias and set their value
// the value is saved in the database instantly! doc.getProperty("bodyText").Value = "<p>Your body text</p>"; doc.getProperty("articleDate").Value = DateTime.Now;

// After modifying the document, prepare it for publishing


User author = User.GetUser(0); doc.Publish(author); // Tell umbraco to publish the document so the updated properties are visible on website umbraco.library.UpdateDocumentCache(doc.Id);

CONTENT & MEDIA API

Using Content & Media API with Razor (detail)


Gateway to Umbraco Data Acess ConentService [ApplicationContext.Current.Services.ContentService] Umbraco.Core namespace ContentService Script (ContentService.txt)

Using Content & Media API with User Controls (brief)


http://umbraco.com/follow-us/blog-archive/2013/1/22/introducingcontentservice-aka-the-v6-api.aspx

http://our.umbraco.org/documentation/Reference/Managementv6/Services/MediaService

FORMS

Built User Generated Forms for the website

Store user generated forms in the Content Node

DATA EDITORS

Extending Umbraco

2 ways:

Usercontrol Wrapper Abstract DataEditors

ADVANCED DATA TYPES


Ultimate Picker

uComponents

SQL Dropdown URL Picker

Custom Data Types

Usercontrol Wrapper

Pros: A simple interface with just one property Supports for all control including ASP.NET AJAX Cons: No custom configuration No control of data storage No control of publishing

Abstract Data Editors

Pros:

Full control for appearance, configuration, storage and publishing

Cons:

Very abstract and complex to implement Requires good knowledge of the umbraco core

Usercontrol Wrapper

Create a Usercontrol Reference umbraco.editorControls assembly Implements interface [umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor] It adds a single method [public object value {set, get}] Usercontrol will appear as a datatype Optional : Reference cms, interface, data assembly Add standard asp:Calendar control example

EVENTS

Overview on v4.7 events

ApplicationEventHandler (v4.9)
Overview on v6 events

IApplicationEventHandler

OnApplicationInitialized
OnApplicationStarted OnApplicationStarting

EVENTS (CONTD)

Examples using v6 events [2.4 Events folder]


PublishingStrategy
Member.AfterSave += Member_AfterSave; Member.AfterDelete += Member_AfterDelete;

Log.Add(LogTypes.Save, sender.Id, We are watching you!);

Storing Published items into another database using Entity Framework & Events (Digital Textile)

EXAMINE/SEARCH

Introduction

Part of core since 4.5 Umbraco Examine is built on Examine, Umbraco and Lucene.net Powerful flexible, extensible and fast search engine for Umbraco Provider Model (Index and Search data source) Multiple Indexes

Index Content, Media, Members

EXAMINE/SEARCH (CONTD)

Setting up search index

Searching for Website


Plugin (Examine Dashboard) http://umbraco.com/follow-us/blogarchive/2011/9/16/examining-examine.aspx

You might also like