blog post - list template

Posted by Community Admin on 03-Aug-2018 23:28

blog post - list template

All Replies

Posted by Community Admin on 09-Mar-2011 00:00

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>


Currently, it is displaying the list of tags in a list item format.  Ideally I would like delimit the tags by commas and appear as hyperlinks that direct to a page that filters based on that particular tag.  Would that be possible to do using templates or should I try another approach to achieve this?

Kind Regards,

Josh

Posted by Community Admin on 10-Mar-2011 00:00

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

Posted by Community Admin on 10-Mar-2011 00:00

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

Posted by Community Admin on 10-Mar-2011 00:00

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()?????

I need a way to retrieve the Tags associatied for this particular blog Post.

Kind Regards,

Josh

Posted by Community Admin on 11-Mar-2011 00:00

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

This thread is closed