Copied to clipboard

Flag this post as spam?

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


  • Jonas Høiby 62 posts 53 karma points
    Oct 18, 2009 @ 19:21
    Jonas Høiby
    0

    change template of doctype via XSLT or other means?

    Hey .. 

     

    in umbraco - is it possible to change template from one to another with ex. xslt? or based on domain name? host-header or so?

     

    ex.

    i have a doc type called:

    myFrontPageDocType

    with a template:

    myFrontPageTemplate

     

    and i want based on some criteria to change that to another template called:

    myAlternateFrontPageTemplate

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Oct 18, 2009 @ 20:41
    Sebastiaan Janssen
    1

    You can add this to the querystring: altTemplate=myAlternateFrontPageTemplate

    So for example: http://www.mydomain.com/home.aspx?altTemplate=myAlternateFrontPageTemplate would give you home.aspx with the myAlternateFrontPageTemplate

     

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Oct 18, 2009 @ 20:42
    Sebastiaan Janssen
    0

    Well that link changed.. should've been mydomain.com/home.aspx?altTemplate=myAlternateFrontPageTemplate (let's home it works now).

  • Jonas Høiby 62 posts 53 karma points
    Oct 19, 2009 @ 08:29
    Jonas Høiby
    0

    kool ... thanks .. :)

     

    but is there any other way of doing it? :-)

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Oct 19, 2009 @ 08:57
    Sebastiaan Janssen
    0

    Not that I know of.. but perhaps other people can chime in?

  • Petr Snobelt 923 posts 1535 karma points
    Oct 19, 2009 @ 09:24
    Petr Snobelt
    0

    You can create macro using renderContent, or use responseRedirect with some urlrewriting.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Oct 19, 2009 @ 09:38
    Sebastiaan Janssen
    0

    If you do go for a responseRedirect, make sure it's a 301 permanent redirect, else Google won't pick up your pages too well.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Oct 19, 2009 @ 09:45
    Dirk De Grave
    0

    Hi,

     

    Adding another syntax for using alternate templates (based on Seb's example):

    www.mydomain.com/home/MyAlternateFrontPageTemplate.aspx

    will also render home page with alternate template

     

    Cheers,

    /Dirk

     

Please Sign in or register to post replies

Write your reply to:

Draft