1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / blog post - list template

blog post - list template

5 posts, 1 answered
  1. Josh
    Josh  avatar
    25 posts
    Registered:
    28 Apr 2009
    09 Mar 2011
    Link to this post
    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
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    10 Mar 2011
    Link to this post
    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
  3. Josh
    Josh  avatar
    25 posts
    Registered:
    28 Apr 2009
    10 Mar 2011
    Link to this post
    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
  4. Josh
    Josh  avatar
    25 posts
    Registered:
    28 Apr 2009
    10 Mar 2011
    Link to this post
    Hi,

    Okay, I was able to register a custom user control within the blog post list template with help from this post:

    http://www.sitefinity.com/devnet/forums/sitefinity-4-x/general-discussions/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
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    11 Mar 2011
    Link to this post
    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
    Answered
5 posts, 1 answered