Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Laurent Lequenne 16 posts 36 karma points
    Jan 24, 2011 @ 20:49
    Laurent Lequenne
    0

    Data parts linking to content with own templates to be rendered.

    I'm currently developping a new site. And I would like to get into a new approach for organizing my pages to let the editor freedom to how he will organizes his page.

    Everypage will be divided in multiple parts, some are fixed and defined in templates (Header, Footers, Menu), other parts will be defined in multiple zones, where the user should assign some other custom content. The content can be anything defined in Umbraco with an attached template, that could be HTML,  a GoogleMap control, a news or Job application.  Is this possible with templates ?

    In my master template, I would be able to call the content and content used for all dataparts defined in my content :

    Let's say my page containts 3 zones : Top - Body - Left that are defined in the document type of my content as links to another content. I do not want to create all templates possibles and the user let choose the one that will match his parts definition. From the master template I would like to call something like the <?UMBRACO_MACRO  ... /> but insteed of calling a macro renderer, i want to call a template renderer.

    Any easy solution to do this ?

     

    Thanks ! 

  • Laurent Lequenne 16 posts 36 karma points
    Jan 28, 2011 @ 10:23
    Laurent Lequenne
    0

    <?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" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
     exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">

    <xsl:output method="html" omit-xml-declaration="yes" />

    <xsl:param name="currentPage"/>
    <xsl:variable name="PageId" select="/macro/PageId"/>
    <xsl:template match="/">
    <xsl:variable name="TemplateId" select="umbraco.library:GetXmlNodeById($PageId)/./@template"/>
    <xsl:value-of select="umbraco.library:RenderTemplate($PageId,$TemplateId)" disable-output-escaping="yes"/>
    </xsl:template>
    </xsl:stylesheet>

Please Sign in or register to post replies

Write your reply to:

Draft