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
Thanks for the handy tool. Can you please provide a sample razor code to render the tags for a document.
Thanks in advance.
Hi Osman,
If you want to render the tags for the current document then you can user the following code:
var tags = Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("aliasOfTagProperty");
You can then loop through the associated pages and list out the tags (and links if you wish) using a standard foreach loop:
@foreach(IPublishedContent tag in tags){ <li class="tag"><a href="@tag.Url">@tag.Name</a></li> }
This should work with the latest version of Tagliatelle as I added property value converter support.
Thanks Jason.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Sample code to render tags
Thanks for the handy tool. Can you please provide a sample razor code to render the tags for a document.
Thanks in advance.
Hi Osman,
If you want to render the tags for the current document then you can user the following code:
You can then loop through the associated pages and list out the tags (and links if you wish) using a standard foreach loop:
This should work with the latest version of Tagliatelle as I added property value converter support.
Thanks Jason.
is working on a reply...