Working in a template file that inherits from Umbraco.Web.Mvc.UmbracoTemplatePage I seem to have really limited methods and properties available to me on the @Model object.
Under @Model.Content for example, I don't have any of the Ancestor or Descendant methods, just Children().
I feel like I'm missing something really obvious but as a bit of a noob could use a nudge.
You're right. Adding the Umbraco.Web namespace gives you most of these extra methods. You could also add the Umbraco.Core namespace which adds a lot of other useful extension methods.
Limited options on @Model object?
Hi,
Working in a template file that inherits from Umbraco.Web.Mvc.UmbracoTemplatePage I seem to have really limited methods and properties available to me on the @Model object.
Under @Model.Content for example, I don't have any of the Ancestor or Descendant methods, just Children().
I feel like I'm missing something really obvious but as a bit of a noob could use a nudge.
Cheers
Rich
OK, so looking into the Umbraco.Core.dll file told me that I need to add the following line to the top of my View, above the inherits line.
using Umbraco.Web;
Seems to have solved the problem, but if anyone in the know wants to set me straight, please do :) Still very much learning my way around v7.
Cheers
Hello,
You're right. Adding the Umbraco.Web namespace gives you most of these extra methods. You could also add the Umbraco.Core namespace which adds a lot of other useful extension methods.
Jeroen
Thanks Jeroen, appreciate the reassurance :)
is working on a reply...