Hi apologise if this is a repost - I had a look and couldn't find what I was after.
I want to run a query against my document types from my layout page to identify whether or not the current page is the home page...if so then do something...if not then donen't.
The rough idea is something similar to the CurrentPage.HasValue("SomeValue") as outlined below:
@if (CurrentPage.HasDocType("Home"))
{
@Html.Partial("umbFeatures", @Model.Content)
}
Can anyone offer any advice on how to go about this?
You're welcome, I'm happy to help :) Remember to keep the topic as solved if this works for you so others who may come across the same issue can quickly go to the solution.
Query Document Types
Hi apologise if this is a repost - I had a look and couldn't find what I was after.
I want to run a query against my document types from my layout page to identify whether or not the current page is the home page...if so then do something...if not then donen't.
The rough idea is something similar to the CurrentPage.HasValue("SomeValue") as outlined below:
@if (CurrentPage.HasDocType("Home"))
{
@Html.Partial("umbFeatures", @Model.Content)
}
Can anyone offer any advice on how to go about this?
Cheers
Hugh
Hi Hugh and welcome to our :)
You should be able to determine the documentype by writing
Hope this helps.
/Jan
Ah brilliant...thanks Jan! :)
Hi Hugh
You're welcome, I'm happy to help :) Remember to keep the topic as solved if this works for you so others who may come across the same issue can quickly go to the solution.
Cheers, Jan
This documentation might also help: http://our.umbraco.org/documentation/Reference/Querying/
Jeroen
is working on a reply...