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

Forums / General Discussions / Filtering Tags In Blog Post Detail

Filtering Tags In Blog Post Detail

12 posts, 0 answered
  1. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    07 Jul 2011
    Link to this post
    We were wanting to show the tags for a given blog post but also to have them be clickable which will then filter out all posts for the given tag. When using the FlatTaxonField control, it only displays the tags and they are not actual links. I know that the TaxonomyControl will allow you to filter either the tags or the categories if you specify the ContentId and the ContentType. Here is how I have my reference to the control in a widget template:

    <sf:TaxonomyControl ID="FlatFieldControl" runat="server"  TaxonomyId="cb0f3a19-a211-48a7-88ec-77495c0f5374" FieldName="Tags" ContentID='<%# Eval("Id") %>' ContentType="Telerik.Sitefinity.Blogs.Model.BlogPost" />

    When I navigate to a blog post, I get the following error:

    Server Error in '/' Application.
     
    You are trying to access item that no longer exists. The most probable reason is that it has been deleted by another user.
     
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
     
    Exception Details: Telerik.Sitefinity.SitefinityExceptions.ItemNotFoundException: You are trying to access item that no longer exists. The most probable reason is that it has been deleted by another user.
     
    Source Error:
     
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
     
    Stack Trace:
     
     
    [ItemNotFoundException: You are trying to access item that no longer exists. The most probable reason is that it has been deleted by another user.]
       DynamicModule.ns.Wrapped_OpenAccessContentProvider_653ecc47ab044bdfbb537854b6933b37.GetContent(Guid id) +253
       Telerik.Sitefinity.Modules.GenericContent.ContentManager.GetContent(Guid id) +45
       Telerik.Sitefinity.Web.UI.PublicControls.TaxonomyControl.GetTaxaFromContentItem() +125
       Telerik.Sitefinity.Web.UI.PublicControls.TaxonomyControl.InitializeTaxaList() +173
       Telerik.Sitefinity.Web.UI.PublicControls.TaxonomyControl.InitializeControls(GenericContainer container) +106
       Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +58
       System.Web.UI.Control.EnsureChildControls() +102
       System.Web.UI.Control.PreRenderRecursiveInternal() +42
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
     
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

    I have even tried using the "OriginalContentId" property as well and I get the same error. Is this a bug, a mis-configuration, or just not an option?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Jul 2011
    Link to this post
    Hello Richard,

    There is a bug about this behavior logged in our system and we will try to fix it for Q2 release. The problem is that the taxons are rendered as plain text not as a links.

    One of the easiest option would be crating a custom control that uses repeater or RadTreeView ( for HierarchicalTaxons ) and put the control reference in the single template used by your control. You can get the taxons for a given content item using GetValue("Tags") method of DataExtensions

    All the best,
    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. Liz
    Liz avatar
    13 posts
    Registered:
    01 Mar 2011
    28 Aug 2011
    Link to this post
    @Richard - Thanks for the post.  I am having the exact same problem and it was nice to be able to find the answer, even though the answer is that it's a bug.

    @Ivan - Can you confirm if this bug was corrected in the Sitefinity 4.2 release?
  4. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    31 Aug 2011
    Link to this post
    Hello Liz,

    The issue has been fixed in 4.2.

    Kind regards,
    Victor Velev
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  5. Liz
    Liz avatar
    13 posts
    Registered:
    01 Mar 2011
    26 Sep 2011
    Link to this post
    Just an update for the thread: I spoke with Telerik form support this morning and due to its complexity, linking tags on a content item level has been upgraded to a Feature.  It has not been fixed in 4.2 nor will it be in 4.2 SP1; we may see the functionality available in 4.3, which is slated for October release at present.
  6. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    08 Dec 2016
    29 Sep 2011
    Link to this post
    Hello Liz,

    Thank you very much for being active and sharing this information in the community. Like I promised during our conversation on Tuesday, I've also synchronized the task with PITS, you can track its proggress and vote for it on this public URL.

    All the best,
    Boyan Barnev
    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
  7. Liz
    Liz avatar
    13 posts
    Registered:
    01 Mar 2011
    29 Sep 2011
    Link to this post
    @Boyan - Thanks for the update!
  8. san
    san avatar
    61 posts
    Registered:
    20 Aug 2010
    09 Jan 2012
    Link to this post
    Is this feature available in Sitefinity 4.3 or do you have any code to implement this kind of a functionality. 
  9. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    08 Dec 2016
    12 Jan 2012
    Link to this post
    Hello,

    We are currently working on the feature implementation so it should be out pretty soon in one of the upcoming releases. In the meantime here's a quick workaround:

    1. Specify what content tags (only blog post tags in your case) should be displayed by the tag widget. To do this open the Designer of the Tags widget and in the field Content Type enter Telerik.Sitefinity.Blogs.Model.BlogPost.
    2. Since in a blog posts widget tags are rendered in span tags, you can use jquery to replace the span with a link for this specific tag from the Tags widget. Take a look at the following sample:
    $("#C009_masterBlogPostsFrontend_ctl00_ctl00_Repeater_ctrl0_FlatFieldControl_ctl00_ctl00_taxaList_ctl01_taxonName").replaceWith('<a href="/kjk/-in-Tags/Tags/MyTag">MyTag</a>');
    This way when you click on the newly created link, you will filter blog posts, depending on the chosen tag.

    Hope you find this information useful.

    Regards,
    Boyan Barnev
    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
  10. santen
    santen avatar
    13 posts
    Registered:
    15 Dec 2010
    25 Jul 2012
    Link to this post
    Hello
  11. santen
    santen avatar
    13 posts
    Registered:
    15 Dec 2010
    25 Jul 2012
    Link to this post
    Hello,
    Boyan, thank you for the reply. The above provided jQuery solution is static and we need to create the links manually. I have used a different approach to dynamically generate the links for the tags using jQuery. I display the tags on the blog listing page and when you click on them they filter the postings according to the clicked tags.
    1. Edit the blog control template to display the tags these tags will be displayed as text. I wrapped my tags inside a div that has a class - tags. I use this as a selector for my jQuery code.
    2. Then I used the code below to generate links for each of the tags that are displayed on the page dynamically.

    $(document).ready(function(){
    if($('.tags .sfTagsList li span').length > 0){
        var Link;
        function DetectSpace(s) {return s.indexOf(' ');}//function to check if space is present
        $('.tags .sfTagsList li').each(function() {
            var Text=($(this).find('span').text().trim());
            var space=DetectSpace(Text);
                if(space != -1) // it means the tag has space, so we need to replace the space with "-"
                    {   Link="<a href=\"/home/about-us/blog/-in-Tags/Tags/"+Text.split(' ').join('-')+"\">"+Text+"</a>";
                        $(this).find('span').replaceWith(Link);
                     }
                else{
                    Link="<a href=\"/home/about-us/blog/-in-Tags/Tags/"+Text+"\">"+Text+"</a>";
                    $(this).find('span').replaceWith(Link);
                    }
            })
        }
    });
  12. EllieZ
    EllieZ avatar
    1 posts
    Registered:
    25 Apr 2013
    12 Dec 2013 in reply to santen
    Link to this post
    Santen - This jQuery solution for linked tags was exactly what I was looking for - took 2 minutes to install and works like a charm (jQuery 1.8.3 library).  THX 8-)
12 posts, 0 answered