
內容簡介
您可以使用 CiviEvent 小工具來新增兩種 CiviCRM 近期公開活動的小工具。您可以無限制地新增任意數量的小工具,並可以像一般側邊欄一樣將它們包含,或者透過簡碼放置在文章內文中。
CiviEvent 列表小工具
此小工具是近期公開活動的基本、彈性列表。您可以自訂外觀和活動數量。如果在活動上啟用「顯示地點」選項,則可以將活動城市、州或國家添加到列表中。
單一 CiviEvent 小工具
此小工具顯示 CiviCRM 的單一公開活動。預設情況下,它會顯示當天或未來的第一個活動,或者您可以設定位移以跳過一個或多個活動,並顯示第二個或第三個即將到來的活動。如果在活動上啟用「顯示地點」選項,則可以顯示位置。
簡碼
兩種小工具都可以使用簡碼插入到文章正文中。使用 [civievent_widget] 簡碼以顯示活動列表,而使用 [civievent_single_widget] 簡碼以顯示下一個(或位移後的)活動。可用的簡碼參數如下:
title="您的標題" 小工具標題(預設值為「即將舉行的活動」,列出小工具的標題,或者使用單一小工具的活動標題)。
summary=1 顯示活動摘要。省略此參數或將其設為 0 即可隱藏摘要。(僅適用於列表小工具。)
limit=5 顯示指定數量的活動(預設值為 5)。(僅適用於列表小工具。)
alllink=1 顯示「查看全部」,並提供連結到完整公開活動列表的頁面。省略此參數或將其設為 0 即可隱藏連結。(僅適用於列表小工具。)
wtheme="mytheme" 小工具主題(添加到小工具 div 的類別)。設置新樣式並在您的主題 CSS 中處理。(列表小工具的預設值為「stripe」,其中備選樣式為「divider」。單一小工具的預設值為「standard」。)
divider=" | " 定位欄分隔符號(預設值為逗號後跟一個空格)。
city=1 顯示活動城市。省略此參數或將其設為 0 即可隱藏城市。
state="abbreviate" 顯示活動的州/省份。預設值為「none」,將不顯示任何有關州或省份的訊息。顯示選項包括「abbreviate」(州/省略字)和「full」(全名)。
country=1 顯示活動國家。省略此參數或將其設為 0 即可隱藏國家。
offset=2 在顯示下一個活動之前跳過給定數量的活動(預設值為 0)。(僅適用於單一小工具。)
admin_type="simple" 是否使用「simple」(預設)或者「custom」顯示選項(在小工具設置中出現)。參數 custom_display 和 custom_filter 只能在 admin_type="custom" 時使用。summary、alllink、divider、city、state 和 country 參數僅在 admin_type="simple"(或回復到預設值)時運作。(僅適用於列表小工具。)
custom_display='{"event_title_infolink":{"title":0,"prefix":null,"suffix":null,"wrapper":1},"description":{"title":1,"prefix":null,"suffix":null,"wrapper":1}}' 在 admin_type="custom" 時自訂顯示結果的選項。值應該是以 JSON 寫入的物件。每個屬性名稱是
外掛標籤
開發者團隊
原文外掛簡介
You can use the CiviEvent widget to add two types of widgets for upcoming public events from CiviCRM. There’s no limit to the number of widgets you can add of either type. You can include the widgets in the sidebar like normal, or you can include them via shortcodes in the body of your posts.
CiviEvent List Widget
This widget is a basic, flexible listing of upcoming events that are marked as public. You have options to customize the appearance and number of events. There is the option to add the event’s city, state, and/or country to the listing if “Show location” is enabled on the event.
Single CiviEvent Widget
This widget displays a single public event from CiviCRM. By default, it will display the first event from the current day or the future, or you can set an offset to skip one or more and display the second or third upcoming event. You may display the location if “Show location” is enabled on the event.
Shortcodes
Both widgets are available to be inserted into the body of a post using a shortcode. Use the [civievent_widget] shortcode for the events listing and the [civievent_single_widget] shortcode for the single next (or offset) event. The available parameters for the shortcodes are as follows:
title="Your Title" The widget title (default: “Upcoming Events” for the list widget, or the event’s title for the single widget).
summary=1 Display the event summary. Omit the parameter or set it to 0 to hide the summary. (List widget only.)
limit=5 Display the specified number of events (default: 5). (List widget only.)
alllink=1 Display “view all” with a link to the page with a full list of public events. Omit the parameter or set it to 0 to hide the link. (List widget only.)
wtheme="mytheme" The widget theme (a class added to the widget div). Set a new one and handle it in your theme’s CSS. (Default for list widget: “stripe”, with “divider” as an alternative. Default for single widget: “standard”.)
divider=" | " The location field delimiter (default: comma followed by a space).
city=1 Display the event’s city. Omit the parameter or set it to 0 to hide the city.
state="abbreviate" Display the event’s state/province. Default is “none”, which will display nothing about the state or province. Display options are “abbreviate” for the state/province abbreviation or “full” for the full name.
country=1 Display the event’s country. Omit the parameter or set it to 0 to hide the country.
offset=2 Skip the given number of events before displaying the next one (default: 0). (Single widget only.)
admin_type="simple" Whether to use the “simple” (default) or “custom” display options (as appear in the widget settings). The custom_display and custom_filter parameters only function alongside admin_type="custom". The summary, alllink, divider, city, state, and country parameters only function when admin_type="simple" (or reverting to the default). (List widget only.)
custom_display='{"event_title_infolink":{"title":0,"prefix":null,"suffix":null,"wrapper":1},"description":{"title":1,"prefix":null,"suffix":null,"wrapper":1}}' Custom options for displaying results when admin_type="custom". The value should be an object written in JSON. Each property name should be a field to display, and the property value should be an object with the following properties: title (1 or 0: whether to display the field name), prefix (null or a string with markup to precede the field), suffix (null or a string with markup to follow the field), and wrapper (1 or 0: whether to wrap the field with the default wrapper elements. You may configure a widget using the standard widget interface, click “Show JSON”, and copy the JSON into this parameter. If custom_display is missing, the listing will revert to displaying in the “simple” mode despite the admin_type value. (List widget only.)
custom_filter='{"start_date": {">=": "2015-12-16"}, "is_public": 1, "options": {"sort": "start_date ASC"}}' Custom options for filtering results when admin_type="custom". The value should be an object written in JSON. The object should be a valid set of parameters for the CiviCRM API. The default is to list all public events starting on today’s date or later, sorted by start date ascending. (List widget only.)
event_type_id=3 Display Event with event type id 3 (default: show all event). (only work with admin_type=”simple”.)
Further Notes
This plugin requires CiviCRM 4.3 or higher to function. It is only supported with CiviCRM 4.6 or higher.
Read more at https://aghstrategies.com/civievent-widget
