I am not too sure on the right controller setup.
I basically already have the function that will read a string for category name and fetch all items of contentTypeAlias and where tag property contains the string.
I want to use that in the right GetNewsItems function and return a view that I have "~Views/NewsList"
In the view I want to render the Master template and then just render the news items and category name.
I made a custom model:
public class NewsListPageViewModel : ContentModel
{
public NewsListPageViewModel(IPublishedContent content) : base(content)
{
}
// Custom properties here...
public IEnumerable<IPublishedContent>? NewsItems { get; set; }
public string? CategoryName { get; set; }
}
But again I am not sure if it should be a ContentModel or normal etc.
I either currently get a blank screen or various errors when trying to do things like include what the master template is.
Umbraco 12/13 custom route
Hi All, Having a few issues with this. I am likely missing a few bits.
My goal is to just have nodes for news and a property to tag their category.
Then for the news/[category] url to be dynamic so I do not have to make parent nodes for each category.
In startup I have:
I am not too sure on the right controller setup. I basically already have the function that will read a string for category name and fetch all items of contentTypeAlias and where tag property contains the string.
I want to use that in the right GetNewsItems function and return a view that I have "~Views/NewsList" In the view I want to render the Master template and then just render the news items and category name.
I made a custom model:
But again I am not sure if it should be a ContentModel or normal etc.
I either currently get a blank screen or various errors when trying to do things like include what the master template is.
Any help would be amazing. Thanks.
is working on a reply...