18 Jul 2012
23 Jul 2009
Link to this post
I think it would be helpful if, isntead of inheriting from UserControl, the generic content templates (newsmasterview, newsdetailsview, eventsmasterview, etc) would inherit from something like ContentViewControl, where each control would have a strongly-typed propery that holds the contentitem in question.
For example, if I'm on the newsview, and want to retrieve properties from the newsitem, I have to call the NewsManager and retrieve this item again. This is redundant, because the control already has this item, as it's using it to populate the page. However, it's not accessible at the page level.
It would be great if we could be in the NewsView and do something like
MyCustomLabel.Text = this.ContentItem.GetMetaData("MyCustomField")
where ContentItem is the IContent item retrieved when the control is initialized.
I hope that this makes sense, and if such feature is already present, please point it out to me as this would save me tons of time!