Show Event category

Posted by Community Admin on 03-Aug-2018 00:20

Show Event category

All Replies

Posted by Community Admin on 05-Oct-2010 00:00

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  

Posted by Community Admin on 05-Oct-2010 00:00

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

Posted by Community Admin on 24-Mar-2011 00:00

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

Posted by Community Admin on 29-Mar-2011 00:00

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

Posted by Community Admin on 12-Oct-2011 00:00

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.

Posted by Community Admin on 12-Oct-2011 00:00

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

Posted by Community Admin on 13-Oct-2011 00:00

Hi,

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

Is their any dll reference for this.

Posted by Community Admin on 13-Oct-2011 00:00

Hi Rakesh,

Please make sure that you use Sitefinity 4.2 edition

www.sitefinity.com/.../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

Posted by Community Admin on 08-Dec-2011 00:00

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.)

Posted by Community Admin on 12-Dec-2011 00:00

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

This thread is closed