Installation Instructions
- Upload
civievent-widget
to the /wp-content/plugins/
directory
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Go to the ‘Widgets’ page in WordPress to add and configure one or more widgets.
- Insert shortcodes into posts or pages as appropriate.
What’s CiviCRM?
CiviCRM is the leading open-source constituent relationship management (CRM) system for nonprofits. This plugin is not CiviCRM, but you can read all about and download CiviCRM at http://civicrm.org. Free to download, free to install and use, free to share, and free to modify, CiviCRM is a great solution for not-for-profit and charitable organizations looking to track donors, event participants, case clients, members, and more.
Why does this plugin exist?
CiviCRM provides full pages of info on single events, plus a poorly-documented page listing all public upcoming events, but there’s no simple widget for listing the events in the WordPress sidebar or as a shortcode that doesn’t overwhelm your page content.
Who’s behind this?
This plugin was developed by AGH Strategies, a CiviCRM consulting firm in Washington, DC. The plugin is driven by our clients’ needs, and others have commissioned features that are important for their organizations.
Read more about us at https://aghstrategies.com/
Why are my widget’s links not working right?
Go into CiviCRM and visit the Manage Events page in the Events menu. Check out the event links there–most likely they are identical to what the widget provides. If the widget’s links cause you trouble, you probably have fundamental problems with your CiviCRM installation: the widgets just use CiviCRM to provide links.
How can I sponsor a new feature?
Like most successful open-source projects, this is a collaboration between a number of users’ needs. If you have an idea for a feature and would like to see it happen, please contact us at https://aghstrategies.com/contact. Even if your budget is small, we can often combine several use cases into a unified new feature, splitting the cost among several organizations.
What’s all this about themes?
You might want to have different CiviEvent widgets on your site look different. Setting the “theme” in the widget settings or the shortcode doesn’t pick a different site theme, but it adds a class to your widget. Using one of the built-in theme options will provide a straightforward display, or you can create your own: just type something new as the widget theme and then add CSS in your site’s theme to handle it. The plugin was built from the perspective that while the widget should look reasonable out-of-the-box, most sites who care strongly about the widget’s appearance will already be implementing a lot of custom CSS. There’s no need for the widget to come with a lot of heavy-handed theming.
How does the Custom API Filter work?
You can write a bit of JSON to filter your results for the CiviEvent List Widget in Custom mode. This uses the syntax for the CiviCRM API. For example, to only include events with online registration enabled, enter {"is_online_registration": 1}
in the Custom API Filter field. By default, results have the event_start_date
greater than or equal to today and have is_public
equal to 1. You can override these.
You can also adjust the limit, sort, or offset by adding items under options
. For example, {"is_online_registration": 1, "options": {"sort": "title ASC", "limit": 3, "offset": 4}}
will display the fifth, sixth, and seventh events in order of title.
Note: CiviCRM’s API takes JSON arrays in some cases. A JSON array is denoted by square brackets. A shortcode is denoted by square brackets. If you use the custom_filter
shortcode parameter to set a custom API filter, you’ll have trouble if you use square brackets for arrays. As a workaround, write arrays as objects with sequentially numbered properties: {"0": "First Thing", "1": "Second Thing"}
instead of ["First Thing","Second Thing"]
.