Articulate icon indicating copy to clipboard operation
Articulate copied to clipboard

Articulate v5: GetAllCategories - not available anymore as UmbracoHelper extension?!

Open wvdweerd opened this issue 1 year ago • 3 comments

In my blog based on Articulate 4.3.2 I used a call to "Umbraco.GetAllCategories(Articulate.Models.IMasterModel)Model)" to get a list of all my blog categories, and displayed these in my custom theme in my CategoryListWidget.cshtml.

Now in v5 this method "GetAllCategories" is only available in the ArticulateTagRepository (https://github.com/Shazwazza/Articulate/blob/develop/src/Articulate/Services/ArticulateTagRepository.cs#L42)

I tried to inject the repository in the view: @inject IArticulateTagRepository articulateTagRepository;

But then I get the error:

InvalidOperationException: Cannot run a repository without an ambient scope.

Is there a way to get this working in v5?

wvdweerd avatar Jan 15 '24 13:01 wvdweerd

@wvdweerd in v5 can you still access the list of categories by going to /blog/categories/

khraibani avatar Jan 15 '24 17:01 khraibani

Feel free to create a PR to add the method to the ArticulateTagService to call the repository method.

Shazwazza avatar Jan 15 '24 17:01 Shazwazza

@khraibani

@wvdweerd in v5 can you still access the list of categories by going to /blog/categories/

No, I get the same error as you get as raised in your issue: https://github.com/Shazwazza/Articulate/issues/439. See my reply there.

wvdweerd avatar Jan 17 '24 12:01 wvdweerd

This is merged and released, so can be closed.

wvdweerd avatar Jun 14 '24 11:06 wvdweerd