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

Forums / Bugs & Issues / Blog Tags Customization

Blog Tags Customization

7 posts, 0 answered
  1. Anu
    Anu avatar
    72 posts
    Registered:
    17 Jun 2010
    06 Jul 2011
    Link to this post
    Hello Admin,

                I have the following requirement :
                - i have 4 Tags in post SEM, SEO, SMO, Google Analytics 
                - I want to Include 
    a tag cloud ( TagName with No of Count ) on Blogs page. ( Blogs Page displays all the list of Post )
                - My BlogPost page is customized (My own User Control ) coz of tht Sitefinities Tags Widget dosent filter the post.It displays 
                  proper TagName with Count
                - Please tel me how Should i Customize Tags Widget functionality ? Which methods are used to Display TagName with
                  Count ?

    Please Help me ...
    Thanks & Regards
    Anu.

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    06 Jul 2011
    Link to this post
    Hi Anu,

    You have to use TaxonomyManager and its methods to get the taxons and list them in your cloud. Then you have to use GetItemsByTaxon method of ContentDataProvider to get the count of content items associated with a given taxon.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Anu
    Anu avatar
    72 posts
    Registered:
    17 Jun 2010
    06 Jul 2011
    Link to this post
    Hello Ivan,

    Thanks for the Reply. Can u give some sample code ?
  4. san
    san avatar
    61 posts
    Registered:
    20 Aug 2010
    09 Jan 2012
    Link to this post
    Hello Anu,

    Did you find any sample code, I am also trying to implement the same functionality?

    Thank you.
  5. san
    san avatar
    61 posts
    Registered:
    20 Aug 2010
    10 Jan 2012
    Link to this post
    Hello Ivan,

    Do you have any sample code to do so?
  6. Matthias
    Matthias avatar
    10 posts
    Registered:
    30 Jul 2009
    09 Feb 2012
    Link to this post
    Hi,

    i created a custom widget to show a cloud of tags associated with posts of my blog.
    The following (simplified) code snippet of my widget .ascx control might not be the best solution, but it works:

    <%@ Control Language="C#" %>
    <%@ Import Namespace="Telerik.Sitefinity" %>
    <%@ Import Namespace="Telerik.Sitefinity.Model" %>
    <%@ Import Namespace="Telerik.Sitefinity.Blogs.Model" %>
    <%@ Import Namespace="Telerik.Sitefinity.Modules.Blogs" %>
    <%@ Import Namespace="Telerik.Sitefinity.Taxonomies" %>
    <%@ Import Namespace="Telerik.Sitefinity.Taxonomies.Model" %>
    <%@ Import Namespace="Telerik.Sitefinity.Modules.GenericContent" %>
     
    <script type="text/C#" runat="server">
    public string BlogID { get; set; }
         
    protected void Page_Load(object sender, EventArgs e) {
                Guid id;
                if (BlogID != "" && Guid.TryParse(BlogID, out id)) {
                    Telerik.Sitefinity.Blogs.Model.Blog blog = App.WorkWith().Blogs().Where(b => b.Id == id).Get().SingleOrDefault();
     
                    if (blog != null) {
     
                        TaxonomyManager taxManager = TaxonomyManager.GetManager();
                        var tags = taxManager.GetTaxonomies<FlatTaxonomy>().Where(t => t.Name == "MyTagClassification").SingleOrDefault();
     
                        if (tags != null) {                      
                            foreach (var tag in tags.Taxa) {
                                RadTagCloudItem item = new RadTagCloudItem();
                                item.Text = tag.Name;
     
                                var posts = App.WorkWith().Blog(blog.Id).BlogPosts().Where(ci => ci.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ci.GetValue<IList<Guid>>("MyTagClassification").Contains(tag.Id)).Get().ToList();
     
                                item.Weight = posts.Count;
                                TagCloud1.Items.Add(item);
                            }
                        }
                    }
                }
            }
    </script>
                     
     <telerik:RadTagCloud ID="TagCloud1" runat="server"></telerik:RadTagCloud


    HTH
    Matthias
  7. san
    san avatar
    61 posts
    Registered:
    20 Aug 2010
    10 Feb 2012
    Link to this post
    Hello Matthias,

    Thank you for your reply and also for providing the code. I was trying to implement the code you have provided below. But, I was thinking how you were associating this widget with each blog post item. Could you please let me know.Sorry, for the question if it is really simple.

    Thank you once again.
7 posts, 0 answered