SFL Plugin for WordPress Store Locator

Release 1.16 : 04/06/2023

GroupMondayTuesdayWednesdayThursdayFriday
Phoenix ESU
8

Intrepid ESU
8

Demo Scout Group
9



2nd New Haw
0





Download the plugin from here
Goto Release History

Summary of Functions

This plugin extends the functions of WordPress Store Locator plugin using filters so you always benefit from any bug fixes and extensions the author of WPSL provides.

  • Amends the nomenclature in the WPSL plugin to use ‘Scout Group’ rather than Store in most places
  • Adds additional fields to the Configuration so sections (with names, times) can be added to the Group
  • Adds additional fields to allow addition of Group Website, Group contact name, partnerships and section type (Group, District or County)
  • Adds a necker designer to allow you to create standard neckers in group colours
  • Allows you to use the Permalink function by providing a group template and corrects the breadcrumbs on this page to work
  • Adds new Group templates (above) which supports subtitle and featured image, includes lots of the shortcodes to give a basic group page.
    The templates provided can be selected in the settings menu
  • Adds a shortcode to provide the section selector dropdown using the store data
  • Lots of Shortcodes and options within them to present your data see examples here : http://2ndnewhawscouts.org.uk/sfl-wpsl/

Installation

Install the plugin in the usual way – there is not config required for the plugin to become active but you must have WPSL installed .
You may want to enable subtitles for the Scout Group pages – goto the Settings for KIA Subtitle and tick the box next to ‘Scout Groups’ to enable them

Nomenclature

Lots of the references in the plugin are changed to Scouting terms – this includes the menus and lists. There are a few left but hopefully people can ignore these!

Scout Group Setup

When you create a new Scout Group by selecting ‘Add New Scout Group’ you will be taken to this screen – add a ‘store’ title which is the Group name or Unit name for Explorers/Network/SASU. You can see in addition to the WPSL options there are 3 new tabs, we have also added some additional fields to the Additional Information tab. In the sections below we will go through these.

You can edit the Group page the same as any other page and if you use the templated Group pages this information is displayed alongside details of the your meetings and location.

1. Additional Information

We have added 2 new fields :

  • Contact is the name of the person that the email relates to – this allows us to show a nice email link on pages
  • Group website is the URL of the Group website – this is useful if you are not using the permalinks function and are using the URL field to reference the page on your own website that you have created for the Group.

2. Section and Meeting Nights

This allows you to maintain sections, day of the week for meetings and times – add one line for each section in a Group or a single line if this is a District or County Unit. Support is provided for Early Years/Squirrels.

3. Group or Unit Necker

This provides an easy way of generating neckers for each of your Groups – most types of necker are supported and you can easily copy the left hand colours to the right hand side for symmetrical neckers. The neckers are fully scalable and never become blocky when shown at any size.

Below the necker is a selector and colour swatches – select the element to update from the dropdown and click on the swatch to update the necker. You can choose any colour using the colour pickers on the colours above the necker.

You can overlay an image on top of the scarf to include scarf badges and embroidery. This should be a PNG file with a transparent background and be 780px by 300px in size. An example is provided in the plugin directory. Load your images into the WordPress media library and use the full URL on the entry screen, You can also use this if your badge is for example tarten to replace the scarf with an image.

4. Other Group Information

You can maintain up to 3 Partnerships – this is designed so you can link Explorer Scout Unit details to the Group. You can also say whether is a Group or a District/County section

Permalinks vs Individual Pages

The permalinks function in WPSL allows you to use a single template to show each Scout Group details rather than creating each one manually. This can make it a lot quicker to create a working website and also means that you can change the template if you want to change all your Scout Group pages. You can try the template and switch back to using fixed URLs without any issue.

Group Display Template

The template uses a format compatible with the SFL theme and supports featured images, breadcrumb links, subtitles (from KIA subtitle) and uses short codes to display lots of information from the Group pages. At the bottom of the template the rest of the Group page is shown. The standard widget area is also provided.

Remember this is only available if you are using Permalinks – see https://2ndnewhawscouts.org.uk/groups/2nd-new-haw/

  • Breadcrumbs: The Scout Groups link will link to the page where you are using the wpsl shortcode
  • Featured Image: If you have maintained one this appears above the page title area
  • Subtitle: If you have used KIA Subtitle to add a subtitle this is displayed under the Group/Unit name
  • Widgets: You can show widgets in the sidebar for the ‘Scout Group’ page type using conditional widget controls (such as the Jetpack one)
  • Main Area: We have created a basic layout which includes most of the information you need. This is a standard template file – these are a bit technical but relatively easy to understand. The template is in the plugin directory and is called single-wpsl_stores.php, At the bottom of this area the rest of the content you have added to the Group editor (in the editor area) is displayed.

When shortcodes with an ID are used in the template the Group/Unit ID is automatically added to the shortcode for you so you don’t need to add it.

As of release 1.11 we provide 4 selectable templates – goto the WP Settings menu and select ‘SFL WPSL Settings’ where you can select for a list of templates – you can add your own templates into the plugin templates directory. The templates also allow you to customize the colour of the header to match your site design.

Shortcodes

We provide a number of shortcodes to allow you to display Group info on any page or in a widget using a simple code. You can add shortcodes using the block editor or just including [<shortcode> ] in text you are editing. All the shortcodes start sfl_wpsl followed by a type. The options field within the shortcode contains a number of words separated by spaces that configure the display of the shortcode.

See https://2ndnewhawscouts.org.uk/sfl-wpsl/ for some examples

Section List

[sfl_wpsl type="sectionlist" option="color days exclude_squirrels exclude_sunday exclude_saturday" categories="62" ] 

This is a very versatile shortcode with lots of options to control the format, content and content. The basic form above – in its most basic form it shows a simple text table showing Groups down the left hand side, section types across the top and days of the week in the grid.

Option Values
  • days : Use the days of the week as the columns for the table
  • sections : Use the sections as the columns for the table
  • scarf : Include the group/unit scarf in the Group column (like in the example above)
  • colour (or color): Display the section name in colour
  • exclude_<section name> : Exclude a given section type – these are the section types in lower case so for example exclude_squirrels
  • exclude_<day of week> : Exclude the day of the week from the grid – again day name is in lowercase so exclude_saturday
  • exclude_<group type> : section type is group, district or county – the section type is maintained on the ‘Other Group Information’ tab
  • exclude_partner : Do not include partnered sections in the Group -use to stop showing a ESU against every Scout group they are partnered with
  • ages : show ages in the grid (or header)
  • 24hr : Show times in 24 hour format (1.11)
  • times : show meeting times in the grid (like the above example)
  • grouplink : make the Group name a link (it will either go to the permalink or the URL from the Additional Infomation tab depending on your config)
  • blob : replace the section name with a coloured circle with a letter for the section type in the grid
  • logo : replace the section name with the section logo in the grid – is only active if the color option is used
  • narrow : show a text only column view rather than the table on both desktop and mobile screen sizes (ideal for widgets)
Categories

Only show Groups within a specific category

id

This will limit the tabe to a specfic Group/Unit – you get get the ID from the edit Group screen URL

Key

[sfl_wpsl type="key" option="blob exclude_squirrels "]

Show a key for tables – either as blobs or text

Options
  • exclude_<section name> : Exclude a given section type – these are the section types in lower case so for example exclude_squirrels
  • blob : Show elements as blobs
  • small : Use extra small blobs for the key
  • logo: Show elements as sectional logos

Group List

[sfl_wpsl type="group_list" option="has_cubs grouplink"]

This gives you simple group lists in a variety of formats and allows you to filter the content

Options
  • grid : Show the list with each group next to each other (rather than a list) – used in the Scarf list above
  • exclude_<group type> : section type is group, district or county – the section type is maintained on the ‘Other Group Information’ tab
  • has_<section type> : Only include the group/unit in the list if it has the section, example has_cubs – does not consider partnerships
  • grouplink : make the Group name a link (it will either go to the permalink or the URL from the Additional Infomation tab depending on your config)
  • scarf : Include the necker graphic
  • side : Show the group name to the side of the scarf – by default it is above the scarf
Categories

Only show Groups within a specific category

Group Section List

[sfl_wpsl type="group_sectionlist" option="color "  id="5737"]

Display a grid of sections with their meeting times and partnered units

id

This is the Group id – you can see this in the URL of the Group editor

Options
  • color: Show section types in color
  • exclude_partner : Do not include partnered sections in the Group -use to stop showing a ESU against every Scout group they are partnered with
  • narrow : Narrower format for widgets etc
  • 24hr : Show times in 24 hour format (1.11)
  • notimes : Do not display times for meetings (ideal if you haven’t maintained these yet)
    If you want to turn off the times in the template file edit the file single-wpsl_stores.php changing the following (in 1.06 it was line 116):
    echo do_shortcode('You need to have a Group ID id='XX' in your shortcode');
    to
    echo do_shortcode('You need to have a Group ID id='XX' in your shortcode');

Group Necker

[sfl_wpsl type="scarf"  id="5800"]

DIsplays the Group/Unit necker for the section with the specified ID – the scarf will scale to fit the area of the screen

id

This is the Group id – you can see this in the URL of the Group editor

Options
  • nomessage : No message will be returned if there is no scarf maintained for the Group

Group Address

[sfl_wpsl type="address"  id="5800"]

DIsplays the Group/Unit address

id

This is the Group id – you can see this in the URL of the Group editor

Options
  • grouplink: Show the group/unit name as a link

Website / Telephone / Email / Waiting List

[sfl_wpsl type="website" label="Website:"]
[sfl_wpsl type="telephone" label="Telephone:"]
[sfl_wpsl type="email" label="Website:"]
[sfl_wpsl type="waitinglist" label="Waiting List:"]

DIsplays the Group/Unit website (with a label) as a link, the telephone or the email as a mailto: link using the contact name as the displayed value

id

This is the Group id – you can see this in the URL of the Group editor

label

The label used before the data

Section Selector

[sfl_wpsl type="group_select"  postcode="/groups" postcode_text="Search by Postcode"]

Display the group selector dropdown – it will scale to the container you have placed it into so can be used in widgets as well as pages.

postcode

This is the URL used for the group search place using the wpsl shortcode – if this is empty then the Search by Postcode entry will not be included

postcode_text

The text used for the dropdown ‘search by postcode entry;

Releases

1.00 Beta : Initial Release
1.01 Beta : Addition of colour swatches on the necker generator
1.02 Beta : Formatting of missing Necker message
1.03 Beta : CSS update
1.04 Beta : Add neckers to Scout Group list in Admin
1.05 Beta : Change Default title when creating new Groups – finally got this to work! Change remaining meta box labels to Scouting terms
Additional grouplink parameter to address block and nomessage parameter for scarf
1.06 Beta : Add notimes option to group_sectionlist shortcode
1.07 Beta : Correction to section times shortcode when no times maintained which broke formatting
1.08 Beta : Ability to add images to scarves/neckers to allow group badges or complete replacement
1.09 Beta : Blank Scarf option to make it easier for Tartan neckers.
1.10 Beta : Example of wide format template page included in directory
1.11 : Add 24hr option to display times in 24hour format for sectionlist and group_sectionlist
If start and end of meeting is set to 12am then time is replaced by ‘Contact Group’
Squirrels have been branded with colour and logo
Keep both times as 12AM and the times will be replaced by contact Group text
1.14 Correction to Partner Groups
1.16 Add Link to Waiting List and shortcode

Things to be done

  • Look at adding easier to manage shortcodes (either via a config screen or in the block editor)
  • Look at County mapping where each District is a different colour or District maps where District sections are a different colour
  • Integrate with OSM section IDs so we can use OSM data and map it across
  • Look at best way of adding people/roles to Groups and Sections