Shortcodes

Use the shortcodes and their parameters to create any number of pages for different calendars (eg: by taxonomy) or combinations of external calendars.   The shortcodes all have default settings, so they will work just plainly as they are. For advanced users, there is powerful set of parameters.

Available shortcodes are:

Shortcode Description amr-events amr-ical-events-list
[events] to list events created within wordpress (and optionally an ics url) with agenda style as default view (or only view) X
[iCal]  to list from ics urls
[largecalendar]  wordpress events and optionally external urls in box calendar
[smallcalendar]   (similar to widget) in small box calendar  Y  Y
[smallplusagenda] the small calendar followed by a simple upcoming events list that will react to selections in the small calendar X**
 [weekscalendar weeks=n] shows a horizontal weekly view. If no weeks parameter, it will default to 2 weeks so if current date is on last day of week, viewer can see next week. Note a vertical weekly view can be achieved using normal agenda view [events], and styling or choosing a suitable list type and grouping.
 [yearcalendar] basically 12 months (default) of small calendar X**
[month_year_dropdown] displays the month and year drop down box in alternate position X*
[month_prev_next] displays the next and previous month links in alternate position eg: after the events shortcode maybe? X*
[calendar_views] displays the view switching in alternate position X*
  • * (available in default position – see parameters)
  • ** (equivalent can be created manually)

Default for  shortcodes:

  • events and ical: listtype: 1, list start from today
  • upcoming events widget: listype : 4, list starts from today
  • largecalendar: listtype: 9, list starts from start of current month
  • smallcalendar: listtype: 8, list starts from start of current month

Optional Parameters

The shortcode parameters will override the corresponding listtype settings.

Any parameters added to the url query string will override the internal listtype settings and the shortcode parameters. This gives you powerful possibilities for showing “tabbed” subsets of events, with some “navigation”. It is also how the widgets can interact with any calendar pages. The small calendar for example can be used to pass parameters to the main calendar page to query a single day of events.
Note that you can experiment with the parameters temporarily by passing them in the URL string of the page.

List of parameters

What to show?

  • ics=url (an external ics url)
  • ignore_query=1 (to stop the plugin from using any values in the query url, useful if you want the widget upcoming events list to be static, not responsive to query parameters such as categories, tags, taxonomies. It will still respond to ‘start’, days, navigation realted parameters.  Use  Ignore_query=all (v4.0.15) to stop ALL response to any query parameters – navigation  and look more will not work with this setting. )
  • eventpoststoo=0 (to ONLY have an external ics files events listed even if you have internal events created by amr-events)
  • cat=id (the category id)
  • category_name=categoryslug
  • tag_id=id (the tag id)
  • tag=tagslug
  • author_name=name (same as wordpress)
  • taxonomy=term (where taxonomy and term have been created by you)

How much to show and when to start ?

  • start=yyyymmdd (the date to start from, used in event monthly/daily navigation, but could be used to hardcode to a particula startdate (begin of year maybe?)
  • daysoffset=n (number of days – can be negative, useful if you want to show some history, eg start from 7 days ago?)
  • startoffset=n same as above, kept for compatibility
  • hoursoffset = n (number of hours – can be negative)
  • monthsoffset=n (number of months – can be negative, will override days and hours)
  • days=n (number of days to show, will start from begin of day)
  • events=n
  • eventsoffset=n  (amr-events only, could be negative?)
  • months=n (will override days and will cause list to start from beginning of month)
  • hours=n (will override months and days, and start from begin of hour, so if you do not want events that have just passed to show, use this)
  • tz=timezonestring (eg: UTC or Sydney/Australia – if you are using events or ics files from different timezones)
  • show_in_events_timezone = 1   – show each event in it’s own timezone.  To avoid confusion, one should probably choose a time format that also displays the timezone

How to format?

  • listtype=n (to switch between preconfigured listtypes)
  • sort_later_events_first=1  (if for example you are showing history and not using navigation)
  • grouping = text (eg: Day, Month, Year, Quarter, Astronomical Season, Traditional Season, Western Zodiac)
  • show_views=0 (to switch off alternate views – the agenda/calendar etc links – use 1 to switch on), default is on
  • show_month_nav=1 (to switch on for agenda, default is off in agenda, but on in calendar
  • show_look_more=1 (to show a link to look for more event at bottom of agenda, similar to the google calendar “look for more”. It has it’s own css tags so you can style it however you like. Also in settings on a single language site, you can set the link text – multi language sites should use translation. )
  • headings=0 (to switch off column headings while leaving configuration in place. headings=1 to switch on)
  • calendar_properties=0 (to switch off the calendar properties heading, while leaving the configuration in place should you change your mind)
  • pagination=0 (to switch off the default pagination at the bottom of the list)
  • day_links=0 (to switch off the link that is generate on the day of the month, currently on by default)
  • agenda=n (the listtype to use for the agenda view option – default = 1)
  • calendar=n (the listtype to use for the calendar view option – default = 9)

 

Other
  • refresh=true or nocache=true (forces a fresh fetch of the file each time )  used in url access only, not as shortcode
  • more_url=http://…. (someone wanted this, but most of you should not need this. day links from box calendar will pass list type=1 to adjust the style, or you can add agenda=n to control it yourself)

…. in theory with wp 3.1 you can actually have all kinds of complicated queries now (these have not been tested as unlikely use by anyone is low, however the way that the plugin interacts with wp means that if you can do it in wp, you should be able to do it with the plugin shortcode! See WP_Query#Parameters EG:

  • ‘category__not_in’ = cat
  • ‘meta_key’ = key
  • ‘meta_value’ = value

IE: one can use whatever taxonomies you create as selection criteria as well as the existing WordPress categories, tags, or author archives. Any selection criteria that you can use in a wordpress query can be added as a parameter

Examples :

  • [events places=sydney] – all events linked to taxonomy places with value sydney
  • [events cat=22] – all events in category 22
  • [events category_name=catslug] – all events in category with slug catslug
  • [events ics=http//someurl] – all events PLUS the external url
  • [events author=1 cat=22] – all events created by admin and in category 22
  • [events listtype=2] – all events using the list with the html, style and layout defined for list type 2
  • [iCal webcal://ical.me.com/somecal.ics]
  • [iCal webcal://ical.me.com/ashowcal listtype=2]
  • [iCal http://anothercal.ics http://hol_cal.ics listtype=3]
  • [iCal http://anothercal.ics days=100 events=10]
  • [iCal http://anothercal.ics startoffset=-7 days=100 events=10]
  • [iCal http://anothercal.ics start=20100101 days=365 events=200]