Shortcode Options
The features of this template can be customized by adding the following options to the Connections shortcode.
Here’s an example shortcode that removes the photo and changes the default label of ‘Cell Phone’ to ‘Cell’. As you see in this example shortcode, you only need to add the options you wish to change from the default setting and you can mix and match the options to suit your needs.
[connections template='slim-plus' image_fallback='none' str_cell_phone='Cell'] |
Here’s the list of options the and their default settings.
enable_search=TRUE enable_pagination=TRUE page_limit=20 pagination_position='after' enable_category_select=TRUE show_empty_categories=TRUE show_category_count=FALSE category_select_position='before' enable_category_by_root_parent=FALSE enable_bio=TRUE enable_bio_head=TRUE enable_note=TRUE enable_note_head=TRUE show_title=TRUE show_org=TRUE show_contact_name=TRUE show_family=TRUE show_addresses=TRUE show_phone_numbers=TRUE show_email=TRUE show_im=TRUE show_social_media=TRUE show_dates=TRUE show_links=TRUE address_types=NULL phone_types=NULL email_types=NULL image='photo' image_fallback='block' str_select='Select Category' str_select_all='Show All Categories' str_image='No Photo Available' str_bio_head='Biography' str_note_head='Notes' str_contact='Contact' str_home_addr='Home' str_work_addr='Work' str_school_addr='School' str_other_addr='Other' str_home_phone='Home Phone' str_home_fax='Home Fax' str_cell_phone='Cell Phone' str_work_phone='Work Phone' str_work_fax='Work Fax' str_personal_email='Personal' str_work_email='Work' name_format='%prefix% %first% %middle% %last% %suffix%' contact_name_format='%label%: %first% %last%' addr_format='%label% %line1% %line2% %line3% %city% %state% %zipcode% %country%' email_format='%label%%separator% %address%' phone_format='%label%%separator% %number%' link_format='%label%%separator% %title%' date_format='%label%%separator% %date%' color='#00508D'
FAQs
Can I switch templates without having to reenter my entries again?
Absolutely! You can switch templates as often as you wish, your entries will be intact. Think of templates for Connections like themes for WordPress. The primary purpose of a WordPress theme is to change the visual style of your site. The primary purpose of Connections’ templates, just like WordPress themes, is to change the visual style of your directory. Just as you can switch themes in WordPress and not loose your pages and posts because they are saved in the WordPress database, you can switch templates in Connections.
As soon as I select a ‘category’ search is performed with the keyword ‘Search’ by default.
This is likely being caused by the theme including a “buggy”, in my opinion, HTML5 shim script. The purpose of these shim scripts is to enable HTML5 features in browsers that do not support them. They work pretty well … but, there seems to be a bug in this shim script.
When you click on a category, the “Search” placeholder string in the search box is being sent as a search keyword term. So you’re actually searching for “Search” within the category being selected. Obviously not what we want to do.
The fix will be to remove the “Search” placeholder text. To do this easily, we can use another plugin.
Changing the search string can be done with the Say What? plugin.
It’ll add a new Text Changes menu item under the Tools admin page.
Click Add New, enter the string exactly as shown in Connections, Search.
Next enter connections (notice the lack of capitalization, that’s important!) as the domain and then enter your new text. In this case leave it blank.
That should fix it.
How do I change the color from blue?
Here are a couple of sample shortcodes to show you how:
/* * Change the color to red: */ [connections color='red'] /* * Change the color to plum: */ [connections color='#660066']
Why does the template layout look wrong?
There are primarily two reasons this issue occurs:
When copy-pasting the shortcode into a page or post while using the rich text editor (the Visual tab), HTML tags will also be pasted. The solution is to paste the shortcode into the HTML editor (the HTML tab) or use the “Paste as Plain Text” button in the Visual editor.
To fix this, go to the page or post where you pasted the Connections shortcode, switch to the HTML editor and remove any HTML tags that surround the shortcode, for example, <pre></pre> and <code></code>.
Two, many commercial themes support shortcodes named [raw]
or [noformat]
. If your theme does, wrap the Connections shortcode within one of them. Here are examples of how to use the [raw]
and [noformat]
shortcodes.
[raw][connections][/raw]
[noformat][connections][/noformat]
Why? The theme is removing and re-applying the wpautop
filter, interfering with all shortcodes. Here’s a link to a comment that explains the issue in more detail: http://wpforce.com/prevent-wpautop-filter-shortcode/#comment-1328. And here’s another link with more info: http://theandystratton.com/2011/shortcode-autoformatting-html-with-paragraphs-and-line-breaks
If the [raw]
or [noformat]
shortcodes do not work; please visit the Support Forum for assistance. A copy of your theme may be required to debug the issue.
UPDATE: 03-15-2013
The package could not be installed. The theme is missing the style.css stylesheet.
I get the following error, what does it mean?
The package could not be installed. The theme is missing the style.css stylesheet.
If you are trying to install a Connections template as a theme you will receive this error. Connections templates must be installed as a plugin. Please following the template installation instructions found here:
http://connections-pro.com/documentation/install/templates/
How do I change the image size?
The templates Excerpt Plus, Excerpt, Slim Plus and Slim require a specific image size and can not be changed (changing the images settings in the admin will not have an affect). These templates will automatically create images from the original source image that are 120px × 100px with a center crop. If you require a specific crop for these images you will have to pre-process the image for the correct crop before uploading them to the entry. If you upload a pre-cropped image using the image ratio of 6:5
the resized image the template creates will maintain its crop.
For example if you have images that you have cropped the way you want the to appear in these templates with the dimensions of 200px × 167px and 110px × 92px you will have to adjust the image sizes to be the correct ratio first. Here’s the math equations that can be used to figure out the correct image sizes:
( width / height ) * new-height = new-width
OR
( height / width ) * new-width = new-height
We’ll use the first equation for the two example images sizes.
Here’s the math for the 200px × 167px image: ( 100px / 120px ) * 167px = 139px
What this shows is the first image width of your pre-cropped image will need to be reduced to be 139px so when it is displayed in the template it will be displayed with the same crop.
One more times with the second image 110px × 92px…
( 100px / 120 px ) * 92px = 76px
The width on this second image which have to be changed to 76px before being uploaded to the entry.
How show an entry open by default?
First create a new category named “Show”. Second, assign every entry you want open by default to the “Show” category.
It’s that easy!
How do I embed a YouTube or Vimeo video in the Bio or Notes field?
To embed videos in to the bio and notes field you must use the WordPress shortcode. The examples show only YouTube and Vimeo, but any of the sites that the shortcode supports can be used.
/* * Example 1 * Embed a YouTube video */ [embed]http://www.youtube.com/watch?v=Zs-8-cWFbOU[/embed] |
/* * Example 2 * Embed a Vimeo video */ [embed]http://vimeo.com/26963550[/embed] |
If you would like to embed a video that pops using a lightbox effect, use the WP Video Lightbox plugin instead of the shortcode.
How do I use the str_***** shortcode options?
Every string in a template can be customized to suit your specific needs. This can be done by setting template-enabled shortcode options. These string shortcode options all begin with “str_”. Every template differs on what strings are available to be customized; please refer to the template’s documentation [currently under construction] to learn more. But here are a couple of examples that will work across most templates.
/* * Example 1 * Change the 'Home Phone' label to 'Phone' */ [connections str_home_phone='Phone'] /* * Example 2 * Change the 'Personal Email' label to 'Email' */ [connections str_personal_email='Email'] /* * Example 3 * You can add as many string customization shortcode options as needed. * * Change the 'Personal Email' label to 'Email' * AND * Change the 'Home Phone' label to 'Phone' */ [connections str_personal_email='Email' str_home_phone='Phone']
How do I use the addr_format shortcode option?
Explaining how the addr_format shortcode option works is difficult, so I will provide some examples.
First, some background.
The addr_format option accepts only a few specific tokens.
Tokens are the % symbols, and the word between, for example, %label%, is a token.
The valid tokens for the addr_format option are:
%label%
[NOTE: unless this is overridden, the label will be the address type.]%line1%
%line2%
%line3%
%city%
%state%
%zipcode%
%country%
When processing the display of the address, Connections will scan for each token and replace it with the corresponding address segment. Each token should only be used once, even though you could use each token more than once, but that is not recommended.
Here’s the default layout of the tokens that create the format of the address:%label% %line1% %line2% %line3% %city%, %state% %zipcode% %country%
Your first question might be, but the address items are stacked in the traditional block layout, not on a single line; how is that being accomplished? The block layout is achieved using CSS, which can easily be overridden to display the address segments inline. How to override the CSS is a separate topic.
On to the examples.
// This will display the address minus the label and country fields. [connections addr_format='%line1% %line2% %line3% %city%, %state% %zipcode%'] // This will display the address with the state and city switched, common in eastern Europe. [connections addr_format='%label% %line1% %line2% %line3% %state%, %city% %zipcode% %country%']
How do I change the number of entries per page?
By default, the template will show 20 entries per page. You can change the number of entries per page by setting a template-enabled shortcode option, page_limit. Here is an example:
[connections page_limit=10]
How can I hide empty categories?
You can hide empty categories by setting a template-enable shortcode option, show_empty_categories. Here’s an example:
[connections show_empty_categories='false']
Plugin Conflicts
Formidable Forms
Formidable Pro ship with an older version of Chosen which breaks Connections use of it. The only solution is to replace the version that ships with Formidable Pro with the newer version that ship with Connections.
Copy the files from this folder:
../wp-content/plugins/connections/vendor/chosen/
to this folder:
../wp-content/plugins/formidable/pro/js/
NOTE: This FAQ was written based on Formidable Forms 1.07.09