Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • suzyb 474 posts 932 karma points
    Jan 12, 2017 @ 10:56
    suzyb
    0

    Retrieve Topic for generic breadcrumb

    I want to have a generic breadcrumb on my forum so have been writing a method to put it together. I have hit a stumbling block however in that when on a topic I cannot retrieve the topic to add to the breadcrumb.

    This is the code I have so far

    [ChildActionOnly]
        public PartialViewResult GetBreadcrumb()
    
            var viewModel = new BreadCrumbViewModel();
    
            if (AppHelpers.CurrentPage().DocumentTypeAlias == AppConstants.DocTypeForumCategory)
            {
                var category = ServiceFactory.CategoryService.Get(CurrentPage.Id, true);
    
                viewModel.Categories = category.ParentCategories;
                viewModel.Category = category;
            }
    
            // how do I check this is a topic and retrieve it to add to the model
    
            return PartialView(PathHelper.GetThemePartialViewPath("GetBreadcrumb"), viewModel);
        }
    

    Retriving the category is simple enough as those pages exist in umbraco however how to I retrieve the topic as it's a virtual page. Can anyone advise?

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft