I´m building a plugin and need to get the category list in html but I can´t manage to get the category list. Anyone who can help me in the right direction.
var categories = _categoryService.GetAllCategories(true);
(boolean param indicating whether to show hidden records)
yes, i think based on the question he needs more info....
- do what "New York" sayd in your Conroller / Service Method. - you have to do "constructor-inject" the ICategoryService .... in your Plugin/Controller/Service wherever you make this. - return a View ( cshtml ) that takes a List<Categorie> as model or a single model an call it for every Category ... the sky is the limit ..
But I´m struggling to get the list of categories into my view.cshtml I have the list in my controller but can´t get it into a model to be used in the view.
I need the list in a model in my view : @Html.Raw(Model.Categories)