ruedacal / razor-mediator-4-tridion

Automatically exported from code.google.com/p/razor-mediator-4-tridion
0 stars 0 forks source link

Models.GetCategory does not exist #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
While there is a Model.GetKeyword, there is no such thing to get a category. I 
am trying to loop in my razor template over every keyword in one specific 
category.

The only way I can do this at the moment is like this:
@foreach (dynamic rawKeyword in 
((Category)TridionHelper.Engine.GetObject(TridionHelper.Engine.LocalizeUri(new 
TcmUri(Package.category_id)))).GetKeywords()) {
                var keyword = Models.GetKeyword(rawKeyword.Id);
}

It would be nice to have a CategoryModel, and that you could get the localised 
keywords for the category the page is getting published to.

Original issue reported on code.google.com by r...@teeuwen.be on 21 Jan 2014 at 4:31