blog post - list template
Hi,
I was trying to create a custom widget template using "Blog post - list" and was wondering if it was at all possible to customize the tags displayed
<
p
class
=
"tags"
>
<
span
class
=
"labels"
>LABELS:</
span
>
<!-- insert tags here -->
<
sitefinity:FlatTaxonField
ID
=
"FlatFieldControl"
DisplayMode
=
"Read"
BindOnServer
=
"true"
runat
=
"server"
TaxonomyId
=
"CB0F3A19-A211-48a7-88EC-77495C0F5374"
WebServiceUrl
=
"~/Sitefinity/Services/Taxonomies/FlatTaxon.svc"
Expanded
=
"false"
TaxonomyMetafieldName
=
"Tags"
Title
=
""
ResourceClassId
=
"TaxonomyResources"
HideWhenNoTaxaFound
=
"true"
CssClass
=
""
Titlelabel
=
""
/>
</
p
>
Hi Josh ,
1. You can use Tags widnget and style it by using sftaxonItem css class
2. Custom control which is bound to a datasource of tags based on the TaxonomyId
. You can use TaxonomyManager to get the ITaxonomy which has Taxa property - collection of Taxons that belong to this taxonomy.
Greetings,
Ivan Dimitrov
the Telerik team
Hi Ivan,
Thank you for the quick reply. Sorry, but I am still getting used to using Sitefinity 4.0. Is it possible to use the tags widget within the "blogs post list" template? And could I import a custom user control within a widget template?
Kind Regards,
Josh
Hi,
Okay, I was able to register a custom user control within the blog post list template with help from this post:
www.sitefinity.com/.../why-viewscount-posts-not-working.aspx
Now I am having trouble trying to get the tags associated with a specific blogPost. So far, my code is as follows:
var dbContainer = this.GetDataItemContainer();
var contentItem = dbContainer != null ? dbContainer.DataItem as Content : null;
if (contentItem != null)
var blogPost = App.WorkWith().AnyContentItem(contentItem.GetType(), contentItem.Id).Get();
this.myTags = blogPost.getTags()?????
Hello Josh ,
You can use GetValue of the content item ( blog post). This is an extension method, so you should have a reference to Telerik.Sitefinity.Model
All the best,
Ivan Dimitrov
the Telerik team