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)
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 :)
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)
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
Works like a charm..Thanks Jan
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
Cool done that, kind of new on the forum. If you did not mention I might not have done it.
thanks again
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
is working on a reply...