Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 10/umbraco-cms/reference/cache/examples/tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For this example we're working with tags. On my site I have two tag properties:

We're going to expose an endpoint that allows us to get the tags from each group.

The tags from the `default` should be cached for a minute and the `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice.
The tags from the `default` should be cached for a minute. The `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice.

## Example

Expand Down
2 changes: 1 addition & 1 deletion 13/umbraco-cms/reference/cache/examples/tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For this example we're working with tags. On my site I have two tag properties:

We're going to expose an endpoint that allows us to get the tags from each group.

The tags from the `default` should be cached for a minute and the `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice.
The tags from the `default` should be cached for a minute. The `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice.

## Example

Expand Down
16 changes: 6 additions & 10 deletions 14/umbraco-cms/reference/cache/examples/tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For this example we're working with tags. On my site I have two tag properties:

We're going to expose an endpoint that allows us to get the tags from each group.

The tags from the `default` should be cached for a minute and the `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice.
The tags from the `default` should be cached for a minute. The `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice.

## Example

Expand Down Expand Up @@ -108,22 +108,18 @@ Now you can inject `ICacheTagService` in any constructor in your project - wohoo

Now that we have our service it's time to create an endpoint where we can fetch the (cached) tags.

{% hint style="warning" %}
The example below uses UmbracoApiController which is obsolete in Umbraco 14 and will be removed in Umbraco 15.
{% endhint %}

```csharp
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using Doccers.Core.Services;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Web.Common.Controllers;


namespace Doccers.Core.Controllers.Api;

public class TagsController : UmbracoApiController
[ApiController]
[Route("/umbraco/api/tags")]
public class TagsController : Controller
{
private readonly ICacheTagService _tagService;

Expand All @@ -133,7 +129,7 @@ public class TagsController : UmbracoApiController
_tagService = tagService;
}

[HttpGet]
[HttpGet("getdefaulttags")]
public IEnumerable<TagModel> GetDefaultTags()
{
// As mentioned earlier we want tags from "default"
Expand All @@ -142,7 +138,7 @@ public class TagsController : UmbracoApiController
TimeSpan.FromMinutes(1));
}

[HttpGet]
[HttpGet("getblogtags")]
public IEnumerable<TagModel> GetBlogTags()
{
// If you don't specify a TimeSpan the object(s)
Expand Down
16 changes: 6 additions & 10 deletions 15/umbraco-cms/reference/cache/examples/tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For this example we're working with tags. On my site I have two tag properties:

We're going to expose an endpoint that allows us to get the tags from each group.

The tags from the `default` should be cached for a minute and the `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice.
The tags from the `default` should be cached for a minute. The `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice.

## Example

Expand Down Expand Up @@ -108,22 +108,18 @@ Now you can inject `ICacheTagService` in any constructor in your project - wohoo

Now that we have our service it's time to create an endpoint where we can fetch the (cached) tags.

{% hint style="warning" %}
The example below uses UmbracoApiController which is obsolete in Umbraco 14 and will be removed in Umbraco 15.
{% endhint %}

```csharp
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using Doccers.Core.Services;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Web.Common.Controllers;


namespace Doccers.Core.Controllers.Api;

public class TagsController : UmbracoApiController
[ApiController]
[Route("/umbraco/api/tags")]
public class TagsController : Controller
{
private readonly ICacheTagService _tagService;

Expand All @@ -133,7 +129,7 @@ public class TagsController : UmbracoApiController
_tagService = tagService;
}

[HttpGet]
[HttpGet("getdefaulttags")]
public IEnumerable<TagModel> GetDefaultTags()
{
// As mentioned earlier we want tags from "default"
Expand All @@ -142,7 +138,7 @@ public class TagsController : UmbracoApiController
TimeSpan.FromMinutes(1));
}

[HttpGet]
[HttpGet("getblogtags")]
public IEnumerable<TagModel> GetBlogTags()
{
// If you don't specify a TimeSpan the object(s)
Expand Down
Loading