More in this section

Forums / General Discussions / Show Event category

Show Event category

10 posts, 0 answered
  1. Ann
    Ann avatar
    16 posts
    Registered:
    25 Aug 2010
    05 Oct 2010
    Link to this post
    I want to display a list of Events sorted by date and show which category/categories each Event belongs to.  I am able to show the sorted list of Events but am not sure how to access any taxonomy information from the Event item itself.  Does Beta 2 have any way of doing this?

    Thanks,
    Ann  
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    05 Oct 2010
    Link to this post
    Hi Ann,

    There is no Fluent API to get the category - Event relation directly. We are working on this now. You could use a dictionary as the sample below illustrates.

    var CatID = new Guid("21d31a1d-c168-45af-a30b-5ad0076c4be9");
    Dictionary<Guid, Event> dict = new Dictionary<Guid, Event>();
    var evManager = EventsManager.GetManager();
    var eventItems = evManager.GetEvents().Where(ev => ((IList<Guid>)ev.GetValue("Category")).Contains(CatID));
        foreach (var _event in eventItems)
        {
            dict.Add(CatID, _event);
            break;
        }
     
    foreach (KeyValuePair<Guid, Event> pair in dict)
    {
     
    }


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Laura
    Laura avatar
    311 posts
    Registered:
    25 Feb 2008
    24 Mar 2011
    Link to this post
    Hi,
    I am using Sitefinity 4.0.1098.0 SE

    In my Event template I added to show the Category(ies) of the event listing with this below:

    <sitefinity:HierarchicalTaxonField ID="HierarchicalFieldControl" runat="server" TaxonomyId="E5CD6D69-1543-427b-AD62-688A99F5E7D4" DisplayMode="Read" WebServiceUrl="~/Sitefinity/Services/Taxonomies/HierarchicalTaxon.svc" Expanded="false" TaxonomyMetafieldName="Category" ExpandText="ClickToAddCategories" BindOnServer="true" />

    However, there is an error on the page. It doesn't like "regex".    With this error, the page freezes in edit mode.  Any idea why this is?
    Uncaught TypeError: Object function (E,F){return new o.fn.init(E,F)} has no method 'format'

    return this.optional(element)||regex.test(value);
    },jQuery.format("The given value does not match the regular expression rule."));

    **Also, how can I put a comma "," in between multiple categories that are listed? I list them horizontally.
    Category1, Category2, etc.

    Thank you
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    29 Mar 2011
    Link to this post
    Hello Laura,

    Are you getting the error on the live website? The error indicates for js conflict which could be caused if you load some js libraries on the page. If the problem persists only in edit mode you can try to register the script from the server, because there you can use expression methods

    IsDesignMode - static method which determines whether the control is in Sitefinity design mode - you  are editing a page.
    IsPreviewMode- determines whether the control is in Sitefinity preview mode.
    IsBackend -determines whether a control instance is in backend.

    sample

    protected override void OnPreRender(EventArgs e)
    {
             base.OnPreRender(e);        
     
             if(this.IsDesignMode() && !this.IsPreviewMode())
             {
                 this.Controls.Clear();
             }   
    }


    Regards,
    Ivan Dimitrov
    the Telerik team
  5. Rakesh
    Rakesh avatar
    72 posts
    Registered:
    11 Jan 2011
    12 Oct 2011
    Link to this post
    Hi Ivan ,
    I got this error..

    "Telerik.Sitefinity.Events.Model.Event' does not contain a definition for 'GetValue'"


    actually I want to get all the Event Categories.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    12 Oct 2011
    Link to this post
    Hello Rakesh,

    Add reference to Telerik.Sitefinity.Model.DataExtensions

    Best wishes,
    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
  7. Rakesh
    Rakesh avatar
    72 posts
    Registered:
    11 Jan 2011
    13 Oct 2011
    Link to this post
    Hi,

    I did not get  "Telerik.Sitefinity.Model.DataExtensions".

    Is their any dll reference for this.
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    13 Oct 2011
    Link to this post
    Hi Rakesh,

    Please make sure that you use Sitefinity 4.2 edition

    http://www.sitefinity.com/40/help/developers-guide/t_telerik_sitefinity_model_dataextensions.html

    Best wishes,
    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
  9. Allen
    Allen avatar
    71 posts
    Registered:
    04 Aug 2007
    08 Dec 2011
    Link to this post
    Am I understand this post correctly?  I want to add an out-of-the-box category widget to a blog page, but I only want categories that are actually associated with blog posts (i.e. I don't want a category assigned to an event item to show up).  Does the category widget only show ALL categories created across every content type?  If that is the case, did I also understand that you are working on functionality to change that behavior?  If the widget should limit itself to the content type to which it is assigned, will you please provide some information on how to make that work. (I have already set the Content Type to Telerik.Sitefinity.Blogs.Model.BlogPost to little affect other than the filtering actually working against the blog widget.)
  10. Hristo Borisov
    Hristo Borisov avatar
    190 posts
    Registered:
    19 Jun 2017
    12 Dec 2011
    Link to this post
    Hello Allen,

    We haven't planned making the categories and tags widgets contextual, so that they can show only relevant taxonomies within the page.

    We have decided to separate the logic of the widget, and avoid any dependencies among the widgets as it will make it hard for customers to extend this functionality to support their own widgets. We also have performance concerns on this scenario where we have to traverse all widgets within the current page in order to output the categories and tags of the content associated with this widget.

    Thank you for suggesting this, it is definitely something we will consider while optimizing the taxonomies widgets in the upcoming Sitefinity 5.0 release. 

    Best wishes,
    Hristo Borisov
    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 posts, 0 answered