O'Reilly logo

Umbraco User's Guide by Paul Sterling, Nik Wahlberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PROVIDING THE LATEST NEWS, EVENTS, AND POSTS

One recurring requirement when you are building custom websites is to provide the ability to autogenerate lists of pages or particular items (outside of standard navigation). For example, most corporate websites have something like Latest News, Upcoming Events, and so on. Obviously, it would be great if you didn't have to manually create those lists and standard content. If you did them manually, you would have to update the content in several places every time you added a news article or event to the site. Enter macros and document types (again). Building on previous examples in Chapter 5 and the use of Runway, Listing 9-4 outputs a listing of FAQs entered in your Runway website.

image The XSLT template in Listing 9-4 is originally based on the List Subpages by Document Type template that you can find in the Create new XSLT dialog (covered in Chapter 5).

LISTING 9-4: ListFaqs.xslt

image
<?xml version=“1.0” encoding=“UTF-8”?> <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp “&#x00A0;”> ]> <xsl:stylesheet version=“1.0” xmlns:xsl=“http://www.w3.org/1999/XSL/Transform” xmlns:msxml=“urn:schemas-microsoft-com:xslt” xmlns:umbraco.library=“urn:umbraco.library” xmlns:Exslt.ExsltCommon=“urn:Exslt.ExsltCommon” xmlns:Exslt.ExsltDatesAndTimes=“urn:Exslt.ExsltDatesAndTimes” ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required