Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I tried to add tag to document programmatically:
var cs = ApplicationContext.Current.Services.ContentService;
var item = cs.GetById(1227);
In another page i need to filter items by tag like this:
var filteredItemsByTag = Umbraco.TagQuery.GetContentByTag("testTagName");
But this method still does not return an item which was added above.
It works only if i "Save and Publish" current item from admin backoffice.
I see in Umbraco.Core that "GetContentByTag " method gets value from RuntimeCacheProvider, which has "Clear()" method, but class is internal, so i can't use it.
Is there any way to get an item?
I have the same problem. Works fine from backoffice but not when tags are added via API.
Hope for answer.
Using IContent SetTags fixed my problem. This has been discussed in this post also: https://our.umbraco.org/forum/developers/api-questions/74836-setting-tags-on-images-via-icontentbase
Hope it helps!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted