To get our user agents then we are tacking on the alt template path after we get the agent. www.domain/my-page/alternateTemplate
This is our issue, because we are doing it dynamically-ish. Since we have multiple Alternate Templates (mobile templates) we are allowing content authors choose the needed alternate template.
I know we can tie the alternate template to our document types which is what we have done. But don't know if this is going to work the way we have our alternate template system set up using C# to tack on the alternate template.
What we are trying to do is get the alternate template for the page and if a template is template1 then choose template1 header if is template2 then choose template2 header. We want to have the least amount of Templates and macros as possible so setting one macro in each of the templates would be the ultimate goal, instead of having the manage a bunch of macros.
Any suggestions would be awesome. But now that I think about it, we may not be able to do it the way we want to since we are sniffing the agent then adding the alternate template.
Get alternate template ID in XSLT
This should be easy. How do you get the Alternate Template ID of the current Node in XSLT?
Does the doc type of the normal template need to also have the AltTemplate tied to it?
Thanks.
Pull the querystring
Hi Carlos
How does the URL of the page look? Which of these two:
domain.com/page.aspx?alttemplate=alternateTemplate
domain.com/page/alternateTemplate.aspx
?
/Kim A
@Kim,
I tried Daniel's solution. Still couldn't get the template.
HOWEVER, this is the way we are applying the template.
We are using inline C# in the template by way of the <script> tag. We are using
string strUserAgent = Request.UserAgent.ToString().ToLower();
and
Request.Browser.IsMobileDevice = true || strUserAgent.Contains("iphone")
To get our user agents then we are tacking on the alt template path after we get the agent. www.domain/my-page/alternateTemplate
This is our issue, because we are doing it dynamically-ish.
Since we have multiple Alternate Templates (mobile templates) we are allowing content authors choose the needed alternate template.
I know we can tie the alternate template to our document types which is what we have done. But don't know if this is going to work the way we have our alternate template system set up using C# to tack on the alternate template.
What we are trying to do is get the alternate template for the page and if a template is template1 then choose template1 header if is template2 then choose template2 header. We want to have the least amount of Templates and macros as possible so setting one macro in each of the templates would be the ultimate goal, instead of having the manage a bunch of macros.
Any suggestions would be awesome. But now that I think about it, we may not be able to do it the way we want to since we are sniffing the agent then adding the alternate template.
is working on a reply...