Change template upon admin selection in umbraco backend
hello all,
As i need to change the templates of a page which displays advertisements at top,bottom,left and right depending upon the admin selection at the backend. if admin choose top from the "pick template" dropdown property in the backend then the page should get displayed using the template with advertisements at the top.
i have four templates for top, bottom, left and right advertisement column separetly. i need to choose the one of the template based on admin selection at the backend. how can i accomplish this task.. is it possible?
Do you want the admin user to be able to pick a template ? or for the template to be automatially picked depending on where the page is within the content tree ?
If you want it manually pickable, then when defining the document type in the setting section, simply associate a number of 'Allowed templates', the admin can then select one of these in preference to the default template when editing.
Okay, so you want to use one of the four templates, depending on more than one condition choosen by the admin in the backend? Then you might want to take a look at the alttemplate-parameter. This is a parameter that you can use to change the template on a node. Let me give you an example:
You have a node inside of Umbraco that uses a template called "temp1" and the node name of that node is "page1". To see the page you go to this url: www.domain.com/page1.aspx. This will show the node using the temp1-template. But let's say that you want to view the same node with another template called "temp2". Then you can go to the page like this: www.domain.com/page1.aspx?alttemplate=temp2 (or even www.domain.com/page1/temp2.aspx). This should give your the ability to change the template on the frontend by linking to the different alttemplates depending on the admin's choices.
Does that make sense?
If you only have one condition that the template depends on, I would for sure just go for the solution that Hendry came up with, and just give the admin the possibility of selecting the right emplate from the "Property"-tab. Would make things a lot easier. But if you have more than one condition, I think you want to use the alttemplate-parametre.
I hope the above gives ou a small clue about how you can use different templates on the rendered site :)
Well, you do not specify HOW different the templates should be.. ? I just allowed my editors to select between different styles for each page, however I could get along just selecting different CSS files.
You could perhaps do something similar ? I set up a content type "css selector" with bullet list selections, then checked for the alias in XLST. You should also be able to access and use the alias in some inline ASP code.
Change template upon admin selection in umbraco backend
hello all,
As i need to change the templates of a page which displays advertisements at top,bottom,left and right depending upon the admin selection at the backend. if admin choose top from the "pick template" dropdown property in the backend then the page should get displayed using the template with advertisements at the top.
i have four templates for top, bottom, left and right advertisement column separetly. i need to choose the one of the template based on admin selection at the backend. how can i accomplish this task.. is it possible?
thank & regrads,
Sony
Hi Sony,
Do you want the admin user to be able to pick a template ? or for the template to be automatially picked depending on where the page is within the content tree ?
If you want it manually pickable, then when defining the document type in the setting section, simply associate a number of 'Allowed templates', the admin can then select one of these in preference to the default template when editing.
HTH,
Hendy
No. what i exactly need is to choose different templates using (xslt or usercontrol) based on some conditions..
thank you Hendy for your reply.. any pointers?
thank you
Okay, so you want to use one of the four templates, depending on more than one condition choosen by the admin in the backend? Then you might want to take a look at the alttemplate-parameter. This is a parameter that you can use to change the template on a node. Let me give you an example:
You have a node inside of Umbraco that uses a template called "temp1" and the node name of that node is "page1". To see the page you go to this url: www.domain.com/page1.aspx. This will show the node using the temp1-template. But let's say that you want to view the same node with another template called "temp2". Then you can go to the page like this: www.domain.com/page1.aspx?alttemplate=temp2 (or even www.domain.com/page1/temp2.aspx). This should give your the ability to change the template on the frontend by linking to the different alttemplates depending on the admin's choices.
Does that make sense?
If you only have one condition that the template depends on, I would for sure just go for the solution that Hendry came up with, and just give the admin the possibility of selecting the right emplate from the "Property"-tab. Would make things a lot easier. But if you have more than one condition, I think you want to use the alttemplate-parametre.
I hope the above gives ou a small clue about how you can use different templates on the rendered site :)
/Kim A
Well, you do not specify HOW different the templates should be.. ? I just allowed my editors to select between different styles for each page, however I could get along just selecting different CSS files.
You could perhaps do something similar ? I set up a content type "css selector" with bullet list selections, then checked for the alias in XLST. You should also be able to access and use the alias in some inline ASP code.
Hi Sony
Did you ever find out how you would solve this issue? Could be nice to know if you used some of our pointers, or if we where totally off.
/Kim A
is working on a reply...