RB Village Extras (rbve)

Description

A collection of extra types and pieces of bonus shortcodes/functionality to help when developing a village website using WordPress. The point is to making it quicker and easier for volunteers to build the sites to help their local community grow without having to develop lots of code, or hack away using a blog post for other types of content.

Village Documents

  • New post type
  • Shortcodes for listing and grouping
  • Gives access to administrator, and also some rights to editors OOTB
  • Use cases: A page listing all council minutes by month, A page listing all newsletters by month, a pod showing x most recent documents uploaded to the site

What this plugin doesn’t do

  • Events – There are so many plugins already that do this well. Two that spring to mind
    ** All in one events calendar (by time.ly) – Good calendar out of the box, and the bix bonus is that it pulls in remote calendars for free (eg. google calendars) which local groups may be running themselves.
    ** The Events Calendar – Simple output allowing some advanced theming with css without hacking away too much
  • User role management – this plugin will create now permissions, but to utilize them, you will need a management plugin
    ** User Role Editor – Possibly a few too many options, but does all you need
  • Image gallery – There are so many plugins already that do this well.
    ** Envira gallery lite – fast, simple, and seems reliable

More info

For further information, enable the module, and go to the settings/info page for the individual post types you would like more information on, as a lot has been put onto there for the end user.

Dependencies

  • cmb2 plugin

Recommendations

Usage

= Village Documents =
1. Click the ‘Village Documents’ in the LHS

Troubleshooting

= Links on homepage blog are going to a 404 =
This is usually down to how your theme is applying the homepage loop, the best fix for this (at present) would be to jump into your themes template file and find the while loop for the blog area. Once you have this you can go inside the <li> and past the below code
post_type === ‘rbve_doc’) {
$post_meta = get_post_meta($post->ID);
print rbve_doc_template($post->post_title, $post_meta[‘_rbve_doc’][0]);
} else { ?>
You will then want to find the closing </li> and add in this closing code

Please do let us know though, as there should be filters handling this now.

The new post types are not available

This can happen when you need to flush the caches, to get around this simply:
* Goto Settings > Permalinks
* Click Save

Future Milestones

  • 1.0.x
    • If no documents returned, give some text (can be overridden with shortcode)
    • improvements from feedback and usage
    • new shortcodes
    • Document management improvements
    • Integration with Publicize (jetpack?) – so on publish, it will share the download link (to the file) with something like ‘ : New uploaded ‘
  • 1.1.0 – Local business/organisation post-type and shortcodes (eg. contact details, opening hours)

Other ideas

  • Ability to add ‘walks and cycle rides’ to the site in a listable way, with printable maps
  • Integration of events with business/organisation pages
  • Ability to link an event to a business (may require time.ly)
  • Some new shortcodes for the time.ly event calendar to add theming flexibility, and potential embedding on business pages
  • Can the templates be handled better (eg. without template files?)

Related reading

= This plugin =
* https://www.smashingmagazine.com/2012/11/complete-guide-custom-post-types/
* https://codex.wordpress.org/Plugin_API/Filter_Reference
* https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content

General WP links

  • https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/

Screenshots

  • Editing a document
  • Rendering lists using the shortcodes

Installation

  1. Ensure dependencies have been activated (eg. cmb2)
  2. Activate the rbve plugin
  3. Refresh admin UI (the ‘Village Documents’ item in the LHS may not appear instantly)
  4. You may want to check the homepage as some themes hardcode how to render posts on the homepage. This will mean the documents may look broken until you update as per troubleshooting section for this plugin.

Optional

  1. Copy/modify the files from /template into your theme directory (eg. themes/colorway) if relevant (tweaks layout for the new types)

FAQ

Please, ask me questions, or give me suggestions, the more the better.

Why do we need a plugin for this?

Whilst some of us may know how to make custom post-types and shortcodes, not everyone does. Therefore this plugin is
to help anyone get a village website running with some basic post-types, template code, and ideas on other plugins you
may also want to use.

Contributors & Developers

“RB Village Extras (rbve)” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.0

Initial release of this plugin with village document support and shortcodes

1.0.1

  • New filter by year (eg. limit results to x most recent)
  • Fix homepage view
  • Added ‘special council minutes’

1.0.2

  • Fix for date issue
  • Added labeltype filter to just show month (without year)
  • show filetype on download link
  • add option to now show filetype in shortcode
  • add annual minutes
  • add ability to hide the group title

1.0.3

1.0.4

  • Added a new method to handle the url for new custom post types

1.0.5

IMPORTANT – when you update, you will want to quickly edit your documents, and update the date field, this will implement to the new ordering method
– Add council agendas to the document types
– Have it say ‘Add New Document’ rather than ‘Add New Page’
– A filter to show all-council-minutes (both special and regular) – special minutes just have a flag next to them (special)
– Need to fix this date issue. Insert a date field, and use that if set. If not set, then use the published date by default.

1.0.6

  • Added Local businesses/organisations
  • Added local clubs/societies