I have a property type of Umbraco.Tags, which I've added to a document type. On my page I have typed a number of tags, that I would ideally like to output on the front-end.
Since version 7.6 Umbraco ships with a value converter for datatypes by default. Therefore you should be able to render the tags like in this example no matter if you're using CSV or JSON as the storage option.
@if(Model.Content.FaqsTaxonomy.Any()){
<ul>
@ foreach(var tag in Model.Content.FaqsTaxonomy){
<li>
<a class="badge @(Request.QueryString["tag"] == tag ? "badge__active" : string.Empty)" href="?tag=@tag">
@tag
</a>
</li>
}
</ul>
}
I have a similar problem. I have added a property "keywords" to a Document Type and I thought I'd try the Tags editor. You'd think this was a common usage for Tags and plenty of working examples - not so - it seems.
It works well until I try to output the tag list in my keywords meta tag.
I can't seem to output the values for a page though. The code I have (copied from this thread) is:
Update:
I've changed the editor type to a textbox and it works fine - although I don't have the nice functionality of the Bootstrap style typeahead etc. Small sacrifice but it looks like Umbraco is missing something - or I am.
Problem outputting tags
Hello,
I have a property type of Umbraco.Tags, which I've added to a document type. On my page I have typed a number of tags, that I would ideally like to output on the front-end.
I cannot work out how to do this.
I thought this was enough:-
Then something like this:-
But I get is this "System.String[]" outputted to screen, Can anyone tell me where I'm going wrong.
I'm using Umbraco 7.11.1
Thanks
Paul
Hi Paul
Since version 7.6 Umbraco ships with a value converter for datatypes by default. Therefore you should be able to render the tags like in this example no matter if you're using CSV or JSON as the storage option.
Does this work out for you?
/Jan
Hi Jan,
Thanks for the reply, I managed to work it out another way.
I was using the string type when I should have been using the string[] type. Also I didn't need the split.
Thanks
Paul
I have a similar problem. I have added a property "keywords" to a Document Type and I thought I'd try the Tags editor. You'd think this was a common usage for Tags and plenty of working examples - not so - it seems. It works well until I try to output the tag list in my keywords meta tag.
I can't seem to output the values for a page though. The code I have (copied from this thread) is:
The output I get is:
Any ideas what I'm doing wrong?
I should add I'm using Umbraco version 7.7.6
Update: I've changed the editor type to a textbox and it works fine - although I don't have the nice functionality of the Bootstrap style typeahead etc. Small sacrifice but it looks like Umbraco is missing something - or I am.
is working on a reply...