From 82b5451d2fbd146721d9154ba41fe884ca0566ac Mon Sep 17 00:00:00 2001 From: Erik-Jan Westendorp Date: Mon, 14 Oct 2024 14:47:15 +0200 Subject: [PATCH 1/5] Update Controller --- 14/umbraco-cms/reference/querying/itagquery.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/14/umbraco-cms/reference/querying/itagquery.md b/14/umbraco-cms/reference/querying/itagquery.md index 8fecca8a4c5..ba221aeb4a6 100644 --- a/14/umbraco-cms/reference/querying/itagquery.md +++ b/14/umbraco-cms/reference/querying/itagquery.md @@ -27,12 +27,12 @@ using System.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Mvc; using Umbraco.Cms.Core.PublishedCache; -using Umbraco.Cms.Web.Common.Controllers; namespace UmbracoHelperDocs.Controllers; -[Route("tags/[action]")] -public class TagApiController : UmbracoApiController +[ApiController] +[Route("/umbraco/api/tags")] +public class TagApiController : Controller { private readonly ITagQuery _tagQuery; @@ -41,6 +41,7 @@ public class TagApiController : UmbracoApiController _tagQuery = tagQuery; } + [HttpGet("getmediatags")] public ActionResult> GetMediaTags() { return _tagQuery.GetAllMediaTags().Select(tag => tag.Text).ToList(); From 9956204195dc26acda126cf1b2b6a848a209b99e Mon Sep 17 00:00:00 2001 From: Erik-Jan Westendorp Date: Mon, 14 Oct 2024 14:47:38 +0200 Subject: [PATCH 2/5] Delete obsolete message --- 14/umbraco-cms/reference/querying/itagquery.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/14/umbraco-cms/reference/querying/itagquery.md b/14/umbraco-cms/reference/querying/itagquery.md index ba221aeb4a6..486ddaa0f37 100644 --- a/14/umbraco-cms/reference/querying/itagquery.md +++ b/14/umbraco-cms/reference/querying/itagquery.md @@ -18,10 +18,6 @@ After this you can use `_tagQuery` to access the `ITagQuery`. If you're using it in controllers, you can inject it into the constructor like so: -{% 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.Collections.Generic; using System.Linq; From 76b1015fec6a5601eef87c0ce979144e1133165b Mon Sep 17 00:00:00 2001 From: Erik-Jan Westendorp Date: Mon, 14 Oct 2024 14:49:15 +0200 Subject: [PATCH 3/5] Update v15 --- 15/umbraco-cms/reference/querying/itagquery.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/15/umbraco-cms/reference/querying/itagquery.md b/15/umbraco-cms/reference/querying/itagquery.md index 8fecca8a4c5..486ddaa0f37 100644 --- a/15/umbraco-cms/reference/querying/itagquery.md +++ b/15/umbraco-cms/reference/querying/itagquery.md @@ -18,21 +18,17 @@ After this you can use `_tagQuery` to access the `ITagQuery`. If you're using it in controllers, you can inject it into the constructor like so: -{% 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.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Mvc; using Umbraco.Cms.Core.PublishedCache; -using Umbraco.Cms.Web.Common.Controllers; namespace UmbracoHelperDocs.Controllers; -[Route("tags/[action]")] -public class TagApiController : UmbracoApiController +[ApiController] +[Route("/umbraco/api/tags")] +public class TagApiController : Controller { private readonly ITagQuery _tagQuery; @@ -41,6 +37,7 @@ public class TagApiController : UmbracoApiController _tagQuery = tagQuery; } + [HttpGet("getmediatags")] public ActionResult> GetMediaTags() { return _tagQuery.GetAllMediaTags().Select(tag => tag.Text).ToList(); From a0c246337153ccb6f80374a85a809cc3551e44df Mon Sep 17 00:00:00 2001 From: Erik-Jan Westendorp Date: Mon, 14 Oct 2024 14:54:05 +0200 Subject: [PATCH 4/5] Write shorter sentences --- 14/umbraco-cms/reference/querying/itagquery.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/14/umbraco-cms/reference/querying/itagquery.md b/14/umbraco-cms/reference/querying/itagquery.md index 486ddaa0f37..44944146f14 100644 --- a/14/umbraco-cms/reference/querying/itagquery.md +++ b/14/umbraco-cms/reference/querying/itagquery.md @@ -4,7 +4,7 @@ description: Working with tags in Umbraco # ITagQuery -The `ITagQuery` interface is your primary way to work with tags in Umbraco, the interface allows you to get the various tags like content tags and media tags, as well as getting content by tag, for instance getting all content nodes with the "Umbraco" tag. +The `ITagQuery` interface is your primary way to work with tags in Umbraco. This interface allows you to get different tags, such as content tags and media tags. It also lets you retrieve content by tag, for instance, getting all content nodes with the "Umbraco" tag. ## How to reference ITagQuery @@ -46,7 +46,7 @@ public class TagApiController : Controller ``` {% hint style="warning" %} -`ITagQuery` is a scoped service, meaning that it should only be injected into scoped or transient services, for more information see the official [Microsoft Documentation](https://docs.microsoft.com/en-us/dotnet/core/extensions/dependency-injection#scoped) +`ITagQuery` is a scoped service, meaning that it should only be injected into scoped or transient services. For more information see the official [Microsoft Documentation](https://docs.microsoft.com/en-us/dotnet/core/extensions/dependency-injection#scoped) {% endhint %} ## Examples @@ -55,7 +55,7 @@ All examples are from a view using the injection shown above, but working with t ### GetAllContentTags(\[string tagGroup]) -Get a collection of tags used by content items on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used by content items on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -66,7 +66,7 @@ Get a collection of tags used by content items on the site, you can optionally p ### GetAllMediaTags(\[string tagGroup]) -Get a collection of tags used by media items on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used by media items on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -77,7 +77,7 @@ Get a collection of tags used by media items on the site, you can optionally pas ### GetAllMemberTags(\[string tagGroup]) -Get a collection of tags used by members on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used by members on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -88,7 +88,7 @@ Get a collection of tags used by members on the site, you can optionally pass in ### GetAllTags(\[string tagGroup]) -Get a collection of tags used on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -149,7 +149,7 @@ Get a collection of tags by entity id (queries content, media and members), and ### GetTagsForProperty(int contentId, string propertyTypeAlias, \[string tagGroup]) -Get a collection of tags assigned to a property of an entity (queries content, media and members), and you can optionally filter by tag group as well +Get a collection of tags assigned to a property of an entity (queries content, media and members). Optionally, you can filter by tag group as well ```csharp @{ From 895ffa80e212050a968b45e464c476fbfb0b200f Mon Sep 17 00:00:00 2001 From: Erik-Jan Westendorp Date: Mon, 14 Oct 2024 14:58:58 +0200 Subject: [PATCH 5/5] Update v10,13 & 15 --- 10/umbraco-cms/reference/querying/itagquery.md | 14 +++++++------- 13/umbraco-cms/reference/querying/itagquery.md | 14 +++++++------- 15/umbraco-cms/reference/querying/itagquery.md | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/10/umbraco-cms/reference/querying/itagquery.md b/10/umbraco-cms/reference/querying/itagquery.md index 69adf0b988d..cd205aeed38 100644 --- a/10/umbraco-cms/reference/querying/itagquery.md +++ b/10/umbraco-cms/reference/querying/itagquery.md @@ -7,7 +7,7 @@ description: "Working with tags in Umbraco" # ITagQuery -The `ITagQuery` interface is your primary way to work with tags in Umbraco, the interface allows you to get the various tags like content tags and media tags, as well as getting content by tag, for instance getting all content nodes with the "Umbraco" tag. +The `ITagQuery` interface is your primary way to work with tags in Umbraco. This interface allows you to get different tags, such as content tags and media tags. It also lets you retrieve content by tag, for instance, getting all content nodes with the "Umbraco" tag. ## How to reference ITagQuery @@ -49,7 +49,7 @@ namespace UmbracoHelperDocs.Controllers ``` {% hint style="warning" %} -`ITagQuery` is a scoped service, meaning that it should only be injected into scoped or transient services, for more information see the official [Microsoft Documentation](https://docs.microsoft.com/en-us/dotnet/core/extensions/dependency-injection#scoped) +`ITagQuery` is a scoped service, meaning that it should only be injected into scoped or transient services. For more information see the official [Microsoft Documentation](https://docs.microsoft.com/en-us/dotnet/core/extensions/dependency-injection#scoped) {% endhint %} ## Examples @@ -58,7 +58,7 @@ All examples are from a view using the injection shown above, but working with t ### GetAllContentTags([string tagGroup]) -Get a collection of tags used by content items on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used by content items on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -69,7 +69,7 @@ Get a collection of tags used by content items on the site, you can optionally p ### GetAllMediaTags([string tagGroup]) -Get a collection of tags used by media items on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used by media items on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -80,7 +80,7 @@ Get a collection of tags used by media items on the site, you can optionally pas ### GetAllMemberTags([string tagGroup]) -Get a collection of tags used by members on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used by members on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -91,7 +91,7 @@ Get a collection of tags used by members on the site, you can optionally pass in ### GetAllTags([string tagGroup]) -Get a collection of tags used on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -152,7 +152,7 @@ Get a collection of tags by entity id (queries content, media and members), and ### GetTagsForProperty(int contentId, string propertyTypeAlias, [string tagGroup]) -Get a collection of tags assigned to a property of an entity (queries content, media and members), and you can optionally filter by tag group as well +Get a collection of tags assigned to a property of an entity (queries content, media and members). Optionally, you can filter by tag group as well ```csharp @{ diff --git a/13/umbraco-cms/reference/querying/itagquery.md b/13/umbraco-cms/reference/querying/itagquery.md index 38fee9a2ace..d6f2d68ca0a 100644 --- a/13/umbraco-cms/reference/querying/itagquery.md +++ b/13/umbraco-cms/reference/querying/itagquery.md @@ -4,7 +4,7 @@ description: Working with tags in Umbraco # ITagQuery -The `ITagQuery` interface is your primary way to work with tags in Umbraco, the interface allows you to get the various tags like content tags and media tags, as well as getting content by tag, for instance getting all content nodes with the "Umbraco" tag. +The `ITagQuery` interface is your primary way to work with tags in Umbraco. This interface allows you to get different tags, such as content tags and media tags. It also lets you retrieve content by tag, for instance, getting all content nodes with the "Umbraco" tag. ## How to reference ITagQuery @@ -45,7 +45,7 @@ public class TagApiController : UmbracoApiController ``` {% hint style="warning" %} -`ITagQuery` is a scoped service, meaning that it should only be injected into scoped or transient services, for more information see the official [Microsoft Documentation](https://docs.microsoft.com/en-us/dotnet/core/extensions/dependency-injection#scoped) +`ITagQuery` is a scoped service, meaning that it should only be injected into scoped or transient services. For more information see the official [Microsoft Documentation](https://docs.microsoft.com/en-us/dotnet/core/extensions/dependency-injection#scoped) {% endhint %} ## Examples @@ -54,7 +54,7 @@ All examples are from a view using the injection shown above, but working with t ### GetAllContentTags(\[string tagGroup]) -Get a collection of tags used by content items on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used by content items on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -65,7 +65,7 @@ Get a collection of tags used by content items on the site, you can optionally p ### GetAllMediaTags(\[string tagGroup]) -Get a collection of tags used by media items on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used by media items on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -76,7 +76,7 @@ Get a collection of tags used by media items on the site, you can optionally pas ### GetAllMemberTags(\[string tagGroup]) -Get a collection of tags used by members on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used by members on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -87,7 +87,7 @@ Get a collection of tags used by members on the site, you can optionally pass in ### GetAllTags(\[string tagGroup]) -Get a collection of tags used on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -148,7 +148,7 @@ Get a collection of tags by entity id (queries content, media and members), and ### GetTagsForProperty(int contentId, string propertyTypeAlias, \[string tagGroup]) -Get a collection of tags assigned to a property of an entity (queries content, media and members), and you can optionally filter by tag group as well +Get a collection of tags assigned to a property of an entity (queries content, media and members). Optionally, you can filter by tag group as well ```csharp @{ diff --git a/15/umbraco-cms/reference/querying/itagquery.md b/15/umbraco-cms/reference/querying/itagquery.md index 486ddaa0f37..44944146f14 100644 --- a/15/umbraco-cms/reference/querying/itagquery.md +++ b/15/umbraco-cms/reference/querying/itagquery.md @@ -4,7 +4,7 @@ description: Working with tags in Umbraco # ITagQuery -The `ITagQuery` interface is your primary way to work with tags in Umbraco, the interface allows you to get the various tags like content tags and media tags, as well as getting content by tag, for instance getting all content nodes with the "Umbraco" tag. +The `ITagQuery` interface is your primary way to work with tags in Umbraco. This interface allows you to get different tags, such as content tags and media tags. It also lets you retrieve content by tag, for instance, getting all content nodes with the "Umbraco" tag. ## How to reference ITagQuery @@ -46,7 +46,7 @@ public class TagApiController : Controller ``` {% hint style="warning" %} -`ITagQuery` is a scoped service, meaning that it should only be injected into scoped or transient services, for more information see the official [Microsoft Documentation](https://docs.microsoft.com/en-us/dotnet/core/extensions/dependency-injection#scoped) +`ITagQuery` is a scoped service, meaning that it should only be injected into scoped or transient services. For more information see the official [Microsoft Documentation](https://docs.microsoft.com/en-us/dotnet/core/extensions/dependency-injection#scoped) {% endhint %} ## Examples @@ -55,7 +55,7 @@ All examples are from a view using the injection shown above, but working with t ### GetAllContentTags(\[string tagGroup]) -Get a collection of tags used by content items on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used by content items on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -66,7 +66,7 @@ Get a collection of tags used by content items on the site, you can optionally p ### GetAllMediaTags(\[string tagGroup]) -Get a collection of tags used by media items on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used by media items on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -77,7 +77,7 @@ Get a collection of tags used by media items on the site, you can optionally pas ### GetAllMemberTags(\[string tagGroup]) -Get a collection of tags used by members on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used by members on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -88,7 +88,7 @@ Get a collection of tags used by members on the site, you can optionally pass in ### GetAllTags(\[string tagGroup]) -Get a collection of tags used on the site, you can optionally pass in a group name to only list tags belonging to a specific tag group +Get a collection of tags used on the site. Optionally, you can pass in a group name to only list tags belonging to a specific tag group ```csharp @{ @@ -149,7 +149,7 @@ Get a collection of tags by entity id (queries content, media and members), and ### GetTagsForProperty(int contentId, string propertyTypeAlias, \[string tagGroup]) -Get a collection of tags assigned to a property of an entity (queries content, media and members), and you can optionally filter by tag group as well +Get a collection of tags assigned to a property of an entity (queries content, media and members). Optionally, you can filter by tag group as well ```csharp @{