If you have a base page that needs to programatically set a div container around the @RenderBody() section if it's not the home page, how do you determine the docType of the page you're displaying? There's nothing sensible coming up in intellisense and I can't find anything useful on line or in the Umbraco documentation.
This is a surprise I deleted this thread 5 mins after I posted it.
I try not to use dynamics if poss. I sorted it with:-
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
@* To control wrapping main content in container tags if not home page *@
bool showContainer = false;
if(Model.Content.DocumentTypeAlias == "HomePage"){
showContainer = true;
}
}
As it was the base tempate, it didn't have the @inherits line in it, which was why intellisense wasn't working.
What's now more interesting is why this thread didn't get deleted.
How to determine what doctype you're on
Umb7.2.1
If you have a base page that needs to programatically set a div container around the @RenderBody() section if it's not the home page, how do you determine the docType of the page you're displaying? There's nothing sensible coming up in intellisense and I can't find anything useful on line or in the Umbraco documentation.
Thnx
Craig
Hi Craig
If you're using the dynamic version then you should be able to use this
Does this work for you?
/Jan
This is a surprise I deleted this thread 5 mins after I posted it.
I try not to use dynamics if poss. I sorted it with:-
As it was the base tempate, it didn't have the @inherits line in it, which was why intellisense wasn't working.
What's now more interesting is why this thread didn't get deleted.
Cheers,
Craig
Hi Craig
That's really weird - Not sure why the post did not delete properly then but good to see you found a solution when using strongly typed :)
/Jan
is working on a reply...