Event Category
Hi,
I have created events and added category also..
Is their any way to list these categories in a drop down ?
(only event categories with their guid)
please help me....its very very urgent..
please...............
Hi,
protected
IQueryable<Event> eventsList;
protected
List<Guid> classifList =
new
List<Guid>();
private
void
GetThemeList(IQueryable<Event> eventsList)
foreach
(Event eI
in
eventsList)
AddToClassifList(eI.GetValue<TrackedList<Guid>>(catTheme));
private
void
AddToClassifList(TrackedList<Guid> listId)
if
(listId !=
null
)
foreach
(Guid taxaId
in
listId)
if
(taxaId != Guid.Empty && !classifList.Contains<Guid>(taxaId))
classifList.Add(taxaId);
"catTheme"
is your own hierarchical category.Hi Nicolas,
I did not understand what you said.I am new to Sitefinity.
What do you mean by
is your own hierarchical category."
"catTheme"
My requirement is..,
I created an event "Event 1" and created a category "Category 1" for this event.
Now I want to load this "Category 1" to a drop down list to filter events.
how can I do this?can you please help me ?
Hi,
you create "Category 1" into Categories on backend ? Or Have you created a Hierarchical Classification on your own and put it into ?
If you use standard Categories :
private
void
GetThemeList(IQueryable<Event> eventsList)
foreach
(Event eI
in
eventsList)
AddToClassifList(eI.GetValue<TrackedList<Guid>>(
"Categories"
));
"eventsList
" by your created events. And Call method GetThemeList, the "classifList
" will be filled by classifications GUID used on your events.private
void
AddToClassifList(TrackedList<Guid> listId)
if
(listId !=
null
)
foreach
(Guid taxaId
in
listId)
if
(taxaId != Guid.Empty && !classifList.Contains<Guid>(taxaId))
classifList.Add(taxaId, TaxonomyManager.GetManager().GetTaxon(taxaId).Title);
Event event1 ....
//return true if a specific category item exist on an event
event1 .Organizer.TaxonExists(
"Categories"
, GuidOfCategory1)
Hi Nicolas,
Thanks for your help.You solved my issue.....thanks a lot...
One more doubt..
I have added thumbnail for Event.Is their any way to get the thumb nail image from the code behind if I have the EventId ?
Thanks and Regards
Rakesh.
Hi,
if your thumbnail is a custom field you can get it like this :
String NameOfCustomField =
"thumbnail"
;
eI.GetValue(NameOfCustomField)