This section is the online technical manual for the plugin with explanations about the coding structure and examples of how to change it.
Skin
A skin is a custom frontend design that works with our backend interface. Below we will explain how you can create your own skin.
The skin folder is placed outside the plugin folder in your uploads folder, this way it will not be overwritten by plugin updates.
The skin folder has four files inside:
card.php
config.php
info.php
style.css
config.php
ID
"id" => "basic_rounded"
This is the id of the ’Skin’, it has to be unique and it must be exactly the same as the name of the folder that houses the skin.
Title
"title" => "basic_rounded"
This is the name of the Skin as it will show in the skin interface in the Team Showcase plugin settings.
Grid
This is the grid type you want to use, you can use four different types:
"grid" => "grid"
Shows members in multiple columns.
"grid" => "carousel"
Shows members in a simple carousel.
"grid" => "table"
Shows members in a table design.
"grid" => "list"
shows members in a single column list
Columns
"columns" => 3
When using a grid or carousel you can set the default number of columns here.
"max_columns" => 3
Here you can set a maximum for the number of columns a user can set.
Extra info
This is the setting for extra info panels, you can use four types
"extrainfo" => "expanded"
Show the extra info in an expanding grid
"extrainfo" => "layover"
Show the extra content in a modal layover.
"extrainfo" => "link"
Open the extra info in the post view
Settings
"settings" => [
"columns"
]
In settings we can activate settings fields, this can be useful when you want to have multiple column options.
We can activate the following options:
- columns - to select the number of columns
Fields
"fields" => [
[
"id" => "position",
"label" => __("Position", "awesome-team-showcase"),
"type" => "text"
],]
The fields are used to create custom fields that you can use to add extra content like phone numbers, position, email addresses etc...
A meta field has three settings:
- id - for setting the ID of the field
- label - this is the label to show next to the field add with a language tag to work with multi language.
- type - this is the field type this can be text, email, number.
card.php
The card.php is the html of the card below you can see an example of our basic card.
info.php
This is the html of the info panel below you can see an example.
The code has a couple of conditional that only show labels when the meta has content.
Meta fields
When creating a showcase you probably need to show extra information for telephone numbers, position or e-mail. For this extra information (metadata) we can assign custom meta fields.
Admin side
If any meta data is created it will show up in the meta data field in team-showcase->members. Here you can fill in the member info that is needed in the showcase.
Only meta data is shown for the selected team showcase. if no team is selected there will be no meta data fields visible.
Config side
When creating a skin folder you can create your own meta fields in the config.php
For this you need to add it
This will show a new meta text field in wp-admin that has the label 'Position'
Html side
To load the content from the meta field into the html we need to add two things in the card.php or info.php
In top of the file we add
$member_meta = get_post_meta(get_the_ID(), "aws_ts_member_meta", true)
then in the code itself we can add this code to show the content when it is added into the meta field
echo ( isset($member_meta["position"]) ? $member_meta["position"] : "" )
Language and Localization
The Team Showcase plugin is 100% translation ready and tested with plugins like WPML, Loco Translate, Polylang and most other multi-language plugins.
Start translating
You can add translations using translation software like PoEdit. In the plugin folder navigate to languages and open awesome-plugins-team-showcase.pot with your translation software. Now start translating and on save it will generate a .MO file in the language that you created.
For example we created the dutch language version which is named awesome-plugins-team-showcase-nl_NL.mo new files will be named the same but with different language tags at then end of the filename.
If this was done correctly your translation should show up in WordPress automatically when you change the site language in Settings to the correct language.
If you want to learn more about how WordPress handles language translation then checkout this link: http://codex.wordpress.org/Translating_WordPress