Copied to clipboard

Flag this post as spam?

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


  • Jay 416 posts 642 karma points
    Jan 06, 2013 @ 21:43
    Jay
    0

    Changing the Template of a page using hyperlink or querystring

    Hi,

    I was wondering if there is a way that I can change the template of a page by using a querystring or hyperlink (where user clicks on different hyperlink which render the page with different template but are showing the exact same content) instead of going into Umbraco and changing them in the Properties tab?

    Or if there is any plugins which allows this to occur?

    The client wanted to click on links / icons on a page to show the current page content in 
    1. List style, or
    2. Column style

    How can I do this if I wish to reuse the content (rather than having a duplication of the contents with different template)

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 06, 2013 @ 22:03
    Jan Skovgaard
    101

    Hi Jeric

    To me it sounds like you could benefit from using an alternate template.

    Even though this blog post is from 2008 the concept is still the same so you can read a bit more about alt templates here http://www.nibble.be/?p=42

    If I understand your need correctly you should use the www.mysite.com/page?alttemplate=liststyle and www.mysite.com/page?alttemplate=columnstyle since using the call to a url would make it seem like there are subpages like www.mysite.com/page/liststyle, which is not the case here.

    So bascially you just create the two alternate templates you need in settings > Templates and then you call them using ?alttemplate=template-alias.

    Please note that you may need to touch the web.config file or recycle the app pool in order for this to work.

    I hope the above makes sense otherwise let me know :)

    /Jan

  • Jay 416 posts 642 karma points
    Jan 07, 2013 @ 14:12
    Jay
    0

    Works like a charm..Thanks Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 07, 2013 @ 22:48
    Jan Skovgaard
    0

    Hi Jeric

    You're very welcome :) - Please remember to mark the correct answer as the solution so it can help others searching for the same answer.

    Cheers,
    Jan 

  • Jay 416 posts 642 karma points
    Jan 08, 2013 @ 08:52
    Jay
    0

    Cool done that, kind of new on the forum. If you did not mention I might not have done it.

     

    thanks again

  • godwin 6 posts 50 karma points
    Jan 11, 2013 @ 09:49
    godwin
    0

    Hi i created a template and document type but the template is not seen in the content, i don't no where i am going wrong. anyone pls help me


Please Sign in or register to post replies

Write your reply to:

Draft