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

Forums / Developing with Sitefinity / Events View DisplayMode

Events View DisplayMode

4 posts, 0 answered
  1. Brandon
    Brandon avatar
    2 posts
    Registered:
    07 Nov 2008
    08 Dec 2008
    Link to this post
    I see that the DisplayMode under EventsView is now obsolete. Is there an alternative way to do this.

    I would like to be able to select the category and select a tag and only feed those results onto the given page.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    11 Dec 2008
    Link to this post
    Hello Brandon,

    You can try using BehaviorMode. As for feeding events only for a certain category and tag you should develop a user control use GetContent method and IMetaSearchInfo filter. Here is an example below:

              string specifiedCategory = "MyCategory"
           string specifiedTag = "MyTag"
             
            // new instance of EM 
            EventsManager eventsManager = new EventsManager("Events"); 
            //add filter 
            List<IMetaSearchInfo> filter = new List<IMetaSearchInfo>(); 
            filter.Add(new MetaSearchInfo(MetaValueTypes.ShortText, "Category", specifiedCategory, SearchCondition.Equal, JoinType.And)); 
     
     
            // get all events using GetContent 
            IList listOfAllEvents = eventsManager.Content.GetContent(0, 0, string.Empty, specifiedTag, nullstring.Empty, null, filter.ToArray()); 
            //show the events by title. 
            foreach (IContent eventItem in listOfAllEvents) 
               Response.Write(eventItem.GetMetaData("Title").ToString() + "<br />"); 
        } 

    I hope this helps.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Brandon
    Brandon avatar
    2 posts
    Registered:
    07 Nov 2008
    11 Dec 2008
    Link to this post

    Not sure if this is exactly what I am looking for. We are actually looking to have the Calendar view control be able to be filtered through categories from a list. Is this possible?

    Also, is there somewhere to find all of the event titles for listOfAllEvents. We have built a control to feed the events onto another page, but we can not find all of the values to use. All we have been able to find is EventTitle, Start, End. We need to knwo the vaules to use for address, city, etc..

    Thank you for your continued help!

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    12 Dec 2008
    Link to this post
    Hi Brandon,

    Sitefinity EventsScheduleView control does not support the desired functionality out of the box. Instead, you could use RadScheduler and bind it to a data source. Then, using the sample code from the previous post you can add a filter and get the events.

    eventItem.ContentItem.GetMetaData("Meta_Field_Key") method returns the value of a given meta field for the current event item. By default, Events module meta fields are: Title, Street, City, Country, State, Event_ Start, Event_End, Publication_Date, Expiration_Date, Contact_Name, Contact_Email, Contact_Phone, Contact_Cell, Contact_Web, Category.

    I hope this helps.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
4 posts, 0 answered