Last active
May 12, 2020 22:06
-
-
Save csharpforevermore/0add1022146dbd68dbc440f800da90df to your computer and use it in GitHub Desktop.
Umbraco 8 - output "Tags" backoffice Data Type values. Description: How to output the value of a Tag data type in the View in Umbraco 8 (using both Model Builder version and non-MB version).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if(!string.IsNullOrEmpty(Request["debug"])){ | |
if(Model.GetProperty("tags") !=null){ | |
<ul> | |
@foreach(var tag in Model.GetProperty("tags").Value<IEnumerable<string>>()){ | |
<li>@tag</li> | |
} | |
</ul> | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if(Model.Tags.Any()){ | |
<ul> | |
@foreach(var tag in Model.Tags){ | |
<li>@tag</li> | |
} | |
</ul> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source: https://our.umbraco.com/documentation/getting-started/backoffice/property-editors/built-in-property-editors/Tags/