*API access is needed for this integration. You can learn more about the included API access by contacting our Support team at support@mobilize.io.
*For more information about our API check out our FAQ.
This Integration was developed by our own Mobilize Champions Community member- Allen Djal from FullStackDigital. We always welcome our community to get creative and take action! Got an idea or integration that you have been working on for your Mobilize community? Share it with us support@mobilize.io.
Check out his article here.
Setup
Download / Early Access
Email us at hello@fullstackdigital.com and we will send you the plugin Zip file. This plugin is free for early adopters. We'd love to get your feedback!
Installing the Plugin
- Download the plugin zip file
- Navigate to plugins and add a new upload plugin
- Upload the zip file
- Activate the plugin
Configure Mobilize
In order to connect your Mobilize account, you'll need to generate an API key.
- Copy your Mobilize API key
- In WordPress, navigate to Settings Mobilize.io for wp
- Select the "API Settings" tab
- Paste your Mobilize.io username
- Paste your Mobilize.io API key
- Save settings
- Your community members should automatically import. View your community members in the Mobilize.io Community menu item.
Demo
This plugin was created as part of a web presence overhaul performed on behalf of {code} Open Source at Dell Technologies. Although it was just a small piece of the overall project, it provided seamless automation for a previously tedious process.
Listing Community Members
This plugin uses custom fields and custom post types. If you are familiar with WordPress queries, displaying a list of community members (custom posts) should be quite easy using a simple post query or using our shortcodes.
Using WordPress Queries
Display a grid or list of community members using a typical WordPress post loop.
Displaying all Mobilize Members
To return a basic list of our community members without segmenting by group or field value, we use typical custom post type arguments.
$args = array(
'post_type' = 'mobilizeio_member',
'post_status' = 'publish',
'nopaging' = true,
'order' = 'DESC',
);
This returns all posts (community members) within the mobilizeio_member post_type.
Displaying Mobilize Members within a Group
This plugin supports Mobilize groups, allowing you to generate a query using a custom taxonomy based on your existing groups.
// Query Arguments$args = array(
'post_type' = mobilizeio_member',
'post_status' = 'publish',
'nopaging' = true,
'order' = 'DESC',
'tax_query' = array(
array(
'taxonomy' = 'mobilizeio_groups',
'field' = 'slug',
'terms' = array(devhigh5),
),
),
);
Use the mobilizeio_groups taxonomy and enter the name, slug, or ID of the selected group.
Using Shortcodes
If you'd rather not generate your own WordPress queries, use shortcodes to return a list of community members.
Shortcodes can be used within most WordPress content editors via the page editor or text widgets. Furthermore, you can also use shortcodes in visual page builders like Beaver Builder.
If you'd prefer to use shortcodes with PHP, use the do_shortcode function.
Display Community Member Profile Images
Shortcodes allow you to return a list of community members' pictures.
The style of the grid and images depends on your own CSS, but the structure is generated by the shortcode.
[fsd_mobilize_bubble
post_type="mobilizeio_member"
taxonomy="mobilizeio_groups"
terms="devhigh5,codecatalyst"
count="12"
row_limit="34"
class="maxwidth-m center-fixed"]
We offer several parameters that allow you to customize the grid:
- Terms: narrow the results to a specific group or groups
- Count: limit the number of community members returned
- Row_limit: limit the number of community members on each row
- Class: add your own class to the wrapping div (for CSS purposes)
Generating Profile Pages
Mobilize members are added as posts within a custom post type. Each community member also has custom fields based on their Mobilize profile fields. As a result, it's possible to create a custom post type template to automatically generate each member's profile page.
Use the shortcode generator to simplify the template creation process.
Using Conditional Shortcodes
When displaying information from each community profile, it might be optimal to use conditional shortcodes.
Conditional shortcodes allow you to hide specific content if a field does not contain a value. Use the shortcode generator in the post editor for a community member to generate a shortcode for a particular field.
For example: for some community pages, you might want to include a header called "skills" to list the skills each member includes in their Mobilize profile. However, some community members might not have any information entered into the skills field. As a result, their profile page would have a "skills" header with no content.
Use a conditional shortcode to display content if a field value exists. Otherwise, display nothing.
[fsd_mobilize_get_group_field_if_exists
group="{code} Catalysts"
field="expertise"
split_string=""
join_string=""]
Expertise
{%MOBILIZE_FIELD%}
[/fsd_mobilize_get_group_field_if_exists]
In this example community page, we display the member name, title, and a dash followed by a company name. In some cases, not every member has a company name. We wouldn't want to display a trailing dash with no content after it.
Member Name
/
[fsd_mobilize_get_group_field_if_exists
group="{code} Catalysts" field="organization_title"]
{%MOBILIZE_FIELD%}
[/fsd_mobilize_get_group_field_if_exists]
[fsd_mobilize_get_group_field_if_exists
group="{code} Catalysts" field="current_work"]
- {%MOBILIZE_FIELD%}
[/fsd_mobilize_get_group_field_if_exists]
In this example, both the job title and company name are conditional fields. The trailing dash only displays if the company name exists.
Displaying Lists
In some cases, a field contains multiple values.
Displaying this field using the normal method would display comma separated values. However, we can customize how these values are displayed and use a list format instead.
- split_string: Designate a common character that separates items in the string, such as a comma.
- join_string: Once the string has been split, join it with this character or HTML.
Example: This conditional shortcode displays values for the field "expertise", replacing the comma separated values with a list format.
[fsd_mobilize_get_group_field_if_exists
group="{code} Catalysts"
field="expertise"
split_string=","
join_string="
"]
Expertise
{%MOBILIZE_FIELD%}
[/fsd_mobilize_get_group_field_if_exists]
Now each item is separated by a
instead of a comma, which creates a list format on the front-end.
Shortcode Generator
Mobilize profile fields are synchronized with custom fields in WordPress. A combination of WordPress custom fields and JSON are used to store profile information. The shortcode generator allows you to easily display the value contained within a field, complete with customization options such as splitting and joining values.
Edit a community member to view the shortcode generator and copy shortcodes for a specific field.
Comments
0 comments
Article is closed for comments.