Specific Events Only
-
Is there a way to display events from a specific CiviEvent event type only?
Or, barring that, is there a way to display only events that take place within a certain timeframe (i.e. April 2016)?
-
Not as things stand, but that would be a nice feature to add. A few of the newer features were commissioned by users, so please let me know if you’re interested.
I am definitely interested in the feature, but sadly I don’t have any budget for commissioning a new feature. Thanks for your reply though.
I just wanted to let you know that I updated the plugin, and the new custom display option will let you filter by CiviCRM API parameters (including date).
Thank you so much!
I have updated it, but I cannot find the Custom API Filter field. Is that located in the widget or is it in the code somewhere?
When you edit the widget from the widgets page, you’ll see the field if you select the Custom tab. The one caveat is that you’ll need to select and configure all your display fields manually, so you might create a new widget instance and play with the options and your theme CSS until it looks like you need.
Hmmm…
I see the Simple and Custom buttons on the widget, however clicking on either one of them does not do anything. Am I looking in the wrong place, or is something broken maybe?
That’s really strange. Those should appear as tabs, with a number of fields in a box below. I just added screenshots at https://ww.wp.xz.cn/plugins/civievent-widget/screenshots/ so the third image is what I’m describing.
Maybe there’s some caching trouble? The admin form now adds some JS and CSS for handling these features, so that may not be loading.
I tried loading it in Firefox (I was using Chrome before) and the tabs appear. I guess the JS is not loading in Chrome for some reason, because I can see “Simple” and “Custom” but no tab underneath of it. It works fine in Firefox, though.
I got to the bottom of this–out of habit as a PHP guy I gave a JS function argument a default value. Firefox doesn’t complain, but others do. Upgrade to 3.1 for the fix–sorry!
Thank you! π It works fine in Chrome now.
I am having a bit of trouble figuring out the custom API section. Can you tell me how I would format it so that the calendar shows only events from a certain date onward?
My hope is to have the widget be able to show all events starting later than today or March 20, whichever is later.
You should set the filter to
{"start_date": {">=": "2016-03-20"}}. There is no handling of complex conditionals (i.e. “whichever is later”): if you want to change it to events after the current date once late March rolls around, you’ll need to change the filter.The parameters are the same as you’d provide the Event.get API.
One final note: custom display and custom filter go together: if you set the custom filter without specifying at least one field to show, the widget will revert to Simple mode.
Okay, thanks! I see now how it works.
Is there any way to use a custom filter and have it still display the default output? It looks like it is not possible to recreate the default look using the event API parameters. Things like “date” are stuck in a format that is hard to customize.
The topic ‘Specific Events Only’ is closed to new replies.