Portal Engine
Version 2.x > Portal Engine > Dynamically Change Page Template View modes: 
User avatar
Member
Member
awalters-designkitchen - 9/30/2008 2:38:17 PM
   
Dynamically Change Page Template
Hello,

Kentico v2.3a

I currently have a set of products that i wish to add a print template to. Essentially, when this button is clicked, i'd like a pop up to appear w/ the product in it, but loaded in a different template.

I cannot simply use CSS as this new template will have 1-2 additional controls...so it's not just a matter of styling, but also requiring additional controls.

Is there a way to set which template to load programmatically? I tried setting CMSContext.CurrentPageInfo.PageTemplateInfo.PageTemplateId = #new_template_id ...but this did not work.

Thanks in advance,
Adam

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 10/1/2008 4:26:06 AM
   
RE:Dynamically Change Page Template
Hi Adam,

I would recommend you to follow this instruction: http://devnet.kentico.com/docs/devguide/print_page.htm to develop your own print page. There is an opportunity to use controls in transformations.

Only problem for you is that you may not use a macro expression in Repeater properties -> Transformation in 2.3a version. I would recommend you to upgrade to 3.x version. The other way is to write a special transformation, which would work for all document types.

Best regards,
Helena Grulichova