Choose a chapter

  1. Introduction
  2. Quick Start
  3. Settings
  4. Main Menu
  5. Level7 Integration Plugin

5. Level7 Integration Plugin

Level 7 Systems provides powerful and customizable plugin for integration of Level 7 platform and Wordpress websites. The plugin enables simple updates of dynamic content of your Level7 Systems web products, allowing for management of dynamic page templates and extends Wordpress shortcode system to give you more control over the page content.

Glossary

  • L7 - Level7Systems
  • LIP - Level7 Integration Plugin
  • WP - Wordpress
  • permalink - permanent URL to individual web page, as well as blog post, page or category; such a URL should be permanent, and never change.

Installation

LIP can be installed as a standard WP plugin to your current WP installation. This can be done by downloading plugin manually to wp-content/plugins path or using WP installer. We recommend reading the complete guide to Managing Plugins in official WP documentation for better understanding.

Requirements

Using LIP is only possible when you are Level 7 Partner and have proper account registered and configured on Partner Portal.

Configuration

After installation LIP is almost ready to use. You just need to set WP API KEY which is required for communication of Level 7 platform and WP website and sets permalinks for dynamic pages or leave the defaults.

WP API Key

In order to be able to update WP site data from Partner Portal, it is required to provide proper WP API KEY of your application. WP API KEY can be found in Partner Portal application in edit WebProduct window - follow steps below:

Voicemail panel

Figure 5.1 Voicemail panel.
  1. Login to Partner Portal
  2. Click Web Products menu option from Settings group
  3. Click Edit from Web Product context menu
  4. Select and copy WP API KEY
  5. Open your administration section of WP site
  6. Click LIP settings section
  7. Paste WP API KEY
  8. Save settings

Permalinks

Dynamic pages (described below) can be accessed via nice, friendly urls. Each group of dynamic pages has its own special url that can be configured in Permalinks section of LIP settings panel. If you are using more than one language, friendly urls can be configured for each language.

Voicemail panel

Figure 5.2 Voicemail panel.

To edit permalinks:

  1. Click LIP settings section
  2. Set proper permalinks
  3. Save settings.

For example, shop or hardware page can be configured to be accessed via /shop or /hardware urls. If you have WPML plugin installed and activated, LIP provides special configuration for urls in each language, e.g:

  • /en/hardware - hardware page in English
  • /pl/sprzet - hardware page in Polish language

Languages used by Web Product are configurable from Partner portal application and can be changed any time.

Pages

LIP during the installation process creates 7 standard WP pages that should be used as a draft for displaying Level7 content - they are already filled with proper content with shortcodes and blocks that can be updated. Each page is responsible for displaying specific content and is using for that special type of tags called shortcodes. * pricing page - displays pricing plans * rates page - displays the costs of calls to landlines and mobiles * telephone numbers page - displays prices for setup and monthly rental * hardware page - displays kind of phone shop page * support page - displays manual * login page - displays login form * register page - display registration form needed for

Those pages can be managed as any other WP pages. They can also be deleted but it is not recommended as they are needed for providing urls to dynamic pages.

Dynamic Page templates

Dynamic Page templates are special type of WP pages that are used as a template for generating dynamic content like phone pages or country call rates - they are already filled with proper content with shortcodes and blocks that can be easily updated. LIP provides 6 templates respectively for: * country call rates - displays call rate for given country; * country virtual numbers - displays virtual numbers available for given country; * state virtual numbers - displays virtual numbers available for given state (US only); * phones group - displays list of phones from given group; * phone details page - displays details of selected phone; * manual chapter - displays given manual chapter;

Voicemail panel

Figure 5.3 Voicemail panel.

Dynamic page templates can be found under LIP menu. To update content for given page template: 1. Click LIP menu option 2. Click Page templates under LIP menu 3. Click on selected template to edit it as standard WP page

Shortcodes

LIP takes the best from WP [shortocde https://codex.wordpress.org/Shortcode] and extend it to offer more powerful tag system.

Conditional statements

LIP allows to render content conditionally. The following constructs are allowed:

multi line:

[if condition]
    <p>Some content if condition is True</p>
[else]
    <p>Some content if condition is False</p>
[/if]

single line:

[if condition]<p>Some content if condition is True</p>[else]<p>Some content if condition is False</p>[/if]

[else] is not obligatory and can be omitted.

Some conditions are listed below:

term_has_local

True if Termination pricelist includes routes to the country of visiting IP address:

[if term_has_local]
    <span>Calls to fixed lines in your country cost [TERM_LOCAL_FIXED], to cell numbers [TERM_LOCAL_FIXED]</span>
[else]
    <span>Sorry, we are unable to terminate calls to your country</span>
[/if]

term_unlimited_local

True if Termination pricelist includes unlimited minutes to the country of visiting IP address (fixed or mobile):

[if term_unlimited_local]
    <span>Calls to your country are free of charge on Unlimited plan.</span>
[else]
    <span>Sorry, Unlimited plan is not available in your country.</span>
[if]

term_local_mobile_free

True if Termination pricelist includes unlimited mobile minutes to the country of visiting IP address:

[if term_local_mobile_free]
    <span>Calls to mobile numbers in your country are free of charge on Unlimited plan.</span>
[/if]

term_local_fixed_free

True if Termination pricelist includes unlimited fixed line minutes to the country of visiting IP address:

[if term_local_mobile_free]
    <span>Calls to fixed lines in your country are free of charge on Unlimited plan.</span>
[/if]

term_is_unlimited

True if Termination pricelist includes unlimited fixed line minutes to the country of visiting IP address:

[if term_local_mobile_free]
    <span>Calls to fixed lines in your country are free of charge on Unlimited plan.</span>
[/if]

term_route_unlimited

True if Termination route is included in Unlimited minutes plan:

[foreach term_routes]
    <tr>
        <td>[TERM_ROUTE_NAME]</td>
        <td>[TERM_ROUTE_PREFIXES]</td>
        <td>[TERM_ROUTE_RATE]
        [if term_route_unlimited]
            (Free*)</td>
        [/if]
    </tr>
[/foreach]

term_route_conn_fee

True if Termination route has connection fee:

[foreach term_routes]
    <tr>
        <td>[TERM_ROUTE_NAME]</td>
        <td>[TERM_ROUTE_PREFIXES]</td>
        <td>[TERM_ROUTE_RATE]
        [if term_route_conn_fee]
            Connection fee: [TERM_ROUTE_CONN_FEE]
        [/if]
    </tr>
[/foreach]

Loops

LIP provides number of pre-defined loops and variables to render dynamic content such as price lists.

The following loops are available:

term_letters

Available on /rates page. Iterates over first letter of country names included in Termination pricelist.

term_countries

Available on /rates page. Iterates over country names to render termination prices, for example:

[foreach term_letters]
    <tr id="[TERM_LETTER]" class="letter"><td colspan="4">[TERM_LETTER]</td></tr>
    
    [foreach term_countries]
        <tr>
            <td><a href="[TERM_ROUTE_URL]">[TERM_ROUTE_COUNTRY]</a></td>
            <td>[if term_is_unlimited]Free[/if]</td>
            <td>[TERM_FIXED]</td>
            <td>[TERM_MOBILE]</td>
        </tr>
    [/foreach]
    
[/foreach]

term_countries

Available on /voip-call-rates/:country page. Iterates over Termination routes within current country, for example:

[foreach term_routes]
    <tr>
        <td>[TERM_ROUTE_NAME]</td>
        <td>[TERM_ROUTE_PREFIXES]</td>
        <td>[TERM_ROUTE_RATE]
        [if term_route_unlimited]
            (Free*)</td>
        [/if]
        [if term_route_conn_fee]
            Connection fee: [TERM_ROUTE_CONN_FEE]
        [/if]
    </tr>
[/foreach]

ddi_paid

Available on /telephone-numbers page. Iterates over DDI pricelist, for example:

[foreach ddi_paid]
    <tr>
        <td><a href="[DDI_COUNTRY_URL]">[DDI_COUNTRY_NAME]</a></td>
        <td>[if ddi_is_unlimited]Free[/if]</td>
        <td>[DDI_SETUP_FEE]</td>
        <td>[DDI_MONTHLY_FEE]</td>
    </tr>
[/foreach]

ddi_national

Available on /telephone-numbers/:country page. Iterates over DDI pricelist, for example:

[if ddi_national]
    [foreach ddi_national]
        <tr>
            <td>National</td>
            <td>([DDI_AREA_CODE])</td>
            <td>[DDI_SETUP_FEE]</td>
            <td>[DDI_MONTHLY_FEE]</td>
            <td><a href="[DDI_BUY_URL]">Buy</a></td>
        </tr>
    [/foreach]
[/if]

ddi_paid

Available on /telephone-numbers page. Iterates over DDI pricelist, for example:

[foreach ddi_paid]
    <tr>
        <td><a href="[DDI_COUNTRY_URL]">[DDI_COUNTRY_NAME]</a></td>
        <td>[if ddi_is_unlimited]Free[/if]</td>
        <td>[DDI_SETUP_FEE]</td>
        <td>[DDI_MONTHLY_FEE]</td>
    </tr>
[/foreach]

ddi_city

Available on /telephone-numbers/:country page. Iterates over DDI pricelist, for example:

[if ddi_ddi_city]

    [foreach ddi_city]
        <tr>
            <td>[DDI_CITY_NAME]</td>
            <td>[if ddi_has_area_code]DDI_AREA_CODE][/if]</td>
            <td>[DDI_SETUP_FEE]</td>
            <td>[DDI_MONTHLY_FEE]</td>
            <td><a href="[DDI_BUY_URL]">Buy</a></td>
      </tr>
  [/foreach]
[/if]

ddi_toll_free

Available on /telephone-numbers/:country page. Iterates over DDI pricelist, for example:

[if ddi_ddi_toll_free]
    
    [foreach ddi_toll_free]
        <tr>
            <td>Toll Free</td>
            <td>[if ddi_has_area_code][DDI_AREA_CODE][/if]</td>
            <td>[DDI_SETUP_FEE]</td>
            <td>[DDI_MONTHLY_FEE]</td>
            <td>[DDI_MIN_RATE]</td>
            <td><a href="[DDI_BUY_TOLL_FREE_URL]">Buy</a></td>
        </tr>
    [/foreach]  

[/if]

Block elements

Block elements are special types of Shortocdes that offer more than just displaying some data. Blocks can display forms, save data or e.g. change website currency.

LIP provides 3 types of blocks: * currency_form - displays form that allow user to change currency; * login_form - displays login form that allow user to login L7 application (user must be registered to be able to login to appliacation); * registration_form - displays registration form that allow user to create Level7 account;

WPML plugin integration

LIP offers also nice integration with WPML plugin wich allows for easy internationalization of WP website.

Configuration

After plugin installation WPML needs to be activated and configured - those steps are described on WPML official sie. The complete guide to plugin configuration and all neccessary setting can be found in official documentation.

Page translations

Pages can be translated from standard Pages panel. It is recommended to read WPML documentation about translating posts and pages content.

Voicemail panel

Figure 5.4 Voicemail panel.

To add translation for given page: 1. Click Pages menu option 2. Click + link for translation you want to add 3. Set title and content 4. You can also copy content from other language 5. Click Publish button to add new page translation

Dynamic Page translations

Dynamic page templates as any other custom WP types are not translatable by default. To active translations of LIP dynamic content we need to enable it in WPML plugin settings:

Voicemail panel

Figure 5.5 Voicemail panel.
  1. Click WPML link
  2. Click Translation Options under WPML menu
  3. In the Custom posts section enable Translation option for Dynamic page templates.
  4. Click Save button to update WPML configuration.

Now dynamic page templates are translatable and can be translated as standard WP pages.

Voicemail panel

Figure 5.6 Voicemail panel.

To add translation for given dynamic page template: 1. Click LIP menu option 2. Click Page templates under LIP menu 3. Click + link for translation you want to add 4. Set title and content 5. You can also copy content from other language 6. Click Publish button to add new page translation

Google XML Sitemap plugin integration

In order to generate XML Sitemap we recommend installing Google XML Sitemap plugin. LIP has already build in integration in order to generate sitemap entries for dynamic pages like phone pages, call rates pages or virtual numbers pages.

Further Customization

Themes

It is recommended to change the default WP theme for better user experience. LIP standard and dynamic pages are custimizable as standard WP pages. For more information visit Wordpress Themes official doc.