Martin Hejtmanek (CTO),

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

Resolution issues and DOI doi>. POLICIES Any form of identifier NUMBERING DESCRIPTION framework: DOI can describe any form of intellectual property, at.
The creation of "Yaolan.com" A Site for Pre-natal and Parenting Education in Chinese by James Caldwell DAE Interactive Marketing a Web Connection Company.
EIONET Training Zope Page Templates Miruna Bădescu Finsiel Romania Copenhagen, 28 October 2003.
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advanced XSLT. Branching in XSLT XSLT is functional programming –The program evaluates a function –The function transforms one structure into another.
Past, Present and Future By Eoin Keary and Jim Manico
1. Define the concept of assertions. 1 Explain the use of assertions. 2 Create Java program using assertions. 3 Run Java program using assertions. 4 2.
1 Web Site Design Overview of the Internet Cookie Setton.
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
JavaScript and AJAX Jonathan Foss University of Warwick
Presenter: James Huang Date: Sept. 29,  HTTP and WWW  Bottle Web Framework  Request Routing  Sending Static Files  Handling HTML  HTTP Errors.
Caching and caching dependencies explained in Kentico CMS
Building Localized Applications with Microsoft.NET Framework and Visual Studio.NET Achim Ruopp International Program Manager Microsoft Corp.
Visual Basic for Applications. What it does Extends the features and built in functions of Excel – Create and run VB procedures – Some may be easy to.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Introduction to Scripting.
DT211/3 Internet Application Development
Using Objects and Properties
C++ for Engineers and Scientists Third Edition
Transformations Revealed
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Chapter 10 Managing Data with ASP.NET. ASP.NET 2.0, Third Edition2.
XSLT for Data Manipulation By: April Fleming. What We Will Cover The What, Why, When, and How of XSLT What tools you will need to get started A sample.
CHAPTER 3 Working with Templates and Styles. CHAPTER OBJECTIVES  Create an Expression Web site from a template  Rename a page  Rename a folder  Add.
Session 1: Advanced Content Model Wednesday 06 February 2007 Sitecore for Experts “Sitecore skills for real men”
Project Implementation for COSC 5050 Distributed Database Applications Lab3.
E-Commerce: Introduction to Web Development 1 Dr. Lawrence West, Management Dept., University of Central Florida Topics What is a Web.
Chapter 8 Cookies And Security JavaScript, Third Edition.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
JAVA SERVER PAGES CREATING DYNAMIC WEB PAGES USING JAVA James Faeldon CS 119 Enterprise Systems Programming.
CMPS 211 JavaScript Topic 1 JavaScript Syntax. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction.
Mark Dixon 1 03 – Passing Data between pages: Forms, Sessions, & Query Strings.
Why Use The Denkh HTML Reporter Scott Auge Amduus Information Works, Inc.
Topics Sending an Multipart message Storing images Getting confirmation Session tracking using PHP Graphics Input Validators Cookies.
CF Pest Control By Shlomy Gantz President, BlueBrick Inc. Presented by Sandra Clark
Keyword Searching Weighted Federated Search with Key Word in Context Date: 10/2/2008 Dan McCreary President Dan McCreary & Associates
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
XP Tutorial 8 Adding Interactivity with ActionScript.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
JavaScript, Fourth Edition
IT ELECTIVE 2.  Web server Can refer to either the hardware (the computer) or the software (the computer application) that helps to deliver content that.
JSP BASICS AND ARCHITECTURE. Goals of JSP Simplify Creation of dynamic pages. Separate Dynamic and Static content.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Users are moving towards web applications Content on the web is more personal & meaningful Development on the web is easier than the OS.
Creating Web Documents: JavaScript Ftp / file management: review Introduction to JavaScript Sources Homework: start review for midterm, work on Project.
Lab 8 Overview Apache Web Server. SCRIPTS Linux Tricks.
©2003 Paula Matuszek GOOGLE API l Search requests: submit a query string and a set of parameters to the Google Web APIs service and receive in return a.
 Java Server Pages (JSP) By Offir Golan. What is JSP?  A technology that allows for the creation of dynamically generated web pages based on HTML, XML,
CHAPTER 7 LESSON C Creating Database Reports. Lesson C Objectives  Display image data in a report  Manually create queries and data links  Create summary.
Copyright Ó Oracle Corporation, All rights reserved. 77 Creating LOVs and Editors.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Developer Exam Preparation Thom Robbins Bryan Soltis
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
Using the Kentico CMS API Thom Robbins Bryan Soltis
URL rewriting and processing in Kentico CMS
World Wide Web has been created to share the text document across the world. In static web pages the requesting user has no ability to interact with the.
JavaScript Tutorial First lecture 19/2/2016. Javascript is a dynamic computer programming language. It is lightweight and most commonly used as a part.
Macros in action Martin Hejtmanek CTO, Kentico software s.r.o.
Performance optimization and caching in Kentico CMS Martin Hejtmanek (CTO), Webinar 9/16/2009.
Advanced transformations in Kentico CMS Martin Hejtmanek (CTO), Webinar 8/19/2009.
Jim Fawcett CSE686 – Internet Programming Spring 2014
Node.js Express Web Applications
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
19.10 Using Cookies A cookie is a piece of information that’s stored by a server in a text file on a client’s computer to maintain information about.
Chapter 19 PHP Part III Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
More Selections BIS1523 – Lecture 9.
Creating web sites from scratch using ASPX model
PHP.
Cookies Cookies are small bits of textual information that a Web server sends to a browser and that the browser returns unchanged when later visiting the.
Intro to Web Services Consuming the Web.
Presentation transcript:

Martin Hejtmanek (CTO), martinh@kentico.com Webinar 11/25/2009 Macros in Kentico CMS Martin Hejtmanek (CTO), martinh@kentico.com

Topics Macro types and syntax Localization macros Context (data) macros QueryString macros Cookie macros Custom macros Path macros Path expressions Macro parameters Macros as the web part properties When to use and not use macros and why

Macro types and syntax Syntax – {<type><expression><type>} Type – Single character $ = Localization % = Context (data) ? = QueryString value @ = Cookie value # = Custom macro ^ = Inline control (not covered today) Optional parameters – {<type><expression>[<parameter>]*<type>} Parameter – |(<name>)<value>

ResHelper.GetString(“General.Cancel”) Localization macros {$expression$} - ($ as string) Localization from resources {$General.Cancel$} ResHelper.GetString(“General.Cancel”) In-place localization – {$=<default text>[<translation>]*$> Translation - |<culture>=<text> {$=Hello|cs-cz=Ahoj|de-de=Hallo$} = switch (currentCulture) { case cs-cz: return “Ahoj”; case de-de: return “Hallo”; default: return Hello; }

Context (data) macros {%expression%} – (% as data value) General context macros – [<selector>.]<fieldname> Available when the given context object is available {%CurrentDocument.DocumentName%} – Current doc. name {%IP%} – Client IP address {%CurrentDateTime%} – Datetime.Now … Data context macros – [<selector>.]<fieldname> Available only for specific modules or actions {%Path%} – Path property from the web part {%OrderStatus.StatusDisplayName%} – In the invoice No specific API code – Just get the desired data using API …

QueryString macros {?expression?} – (? as query) Available within the page request {?param1?} Request.QueryString[“param1”]

Cookie macros {@expression@} – (@ as internet / cookie) Available within the page request {@CMSPreferredCulture@} CookieHelper.GetValue(“CMSPreferredCulture”)

Custom macros {#expression#} - (# as C# or code) Not processed by engine, processed by YOUR CODE! {#TimeToEndOfTheWorld#} ~/App_Code/Global/CMS/CMSCustom.cs CMSCustom.ResolveCustomMacro(resolver, “TimeToEndOfTheWorld”, out bool match) public static string ResolveCustomMacro(MacroResolver sender, string expression, out bool match) { if (expression.ToLower() == "timetoendoftheworld“) { match = true; return (new DateTime(2012,12,21).Subtract(DateTime.Now)).ToString(); } else { match = false; return expression; } }

Path macros {&expression&} – (& as path) Resolves AliasPath – See previous webinar {&./Teaser&} – Document named Teaser under current document {&/{1}/{3}&} – First and third level of current document path CMSContext.ResolveCurrentPath(“./Teaser”)

Path expressions for macros . = Current document path (only on beginning) .. = Parent document path (if on beginning, starts from current) {<index>} = Specific part of current document path How to read the path expressions ./Teaser – “Teaser document under current document ../Teaser – “Teaser document under the parent document /Products/{1}/{2} – Document in products section matching the first two levels of current path /Accessories/{1}/% - All accessories within the same main section as current product

Macro parameters |(name)value Culture, Format, Default, Encode, ToLower, ToBool, Equals, … Full list in the documentation – Appendix A {?param1|(default)N/A?} QueryString value of param1 or N/A if not available {%CurrentDocument.DocumentName|(encode)false%} Current document name, never HTML encoded {%CurrentDocument.DocumentName|(encode)true%} Current document name, always HTML encoded

Macros in web part properties All web part properties are resolved unless it is disabled Some of them may be excluded CMSAbstractWebPart.mNotResolveProperties = “;yourproperty1;yourproperty2;”; Some of them may automatically escape SQL injection CMSAbstractWebPart.mSQLProperties = “;wherecondition;orderby;yourproperty;”; Web part property can use data macro to use another property Text = Container title is {%ContainerTitle%} If you need to do some web part setting dynamic, use custom macro

When to use and not use macros Use macros in: Web part properties (even non-text ones) E-mails and other templates Anywhere where it is recommended in the documentation In places where you need to set up something dynamically, it is easier to use macro than Copy – Paste – Change the web part Don’t use macros for: ASPX page templates Transformations Layouts In places where you have direct access to the API, it is more efficient to query the objects directly

Q&A Now is the time for your questions The webinar recording will be available on our new Partner portal and later on the DevNet.