Migrating from CMS Navigation to WPML
WPML includes the functionality of CMS Navigation, with several critical improvements. It produces much cleaner HTML, that’s easier to customize and style and can be controlled from the admin screen.
The old CMS Navigation cannot be activated together with WPML. This is what you’ll need to do in order to migrate:
- Replace the old navigation elements in your theme with the new ones.
- Deactivate CMS Navigation.
- Activate WPML
If you do it in this exact order, your migration process will be smooth.
Replacing the old CMS Navigation elements with WPML elements
Your theme includes calls to functions in CMS Navigation in order to display the top tabs, breadcrumbs and sidebar navigation. We’ll need to replace those with the new style calls for WPML.
| Element | CMS Navigation call (old) | WPML call (new) | |
|---|---|---|---|
| Top tabs | <?php cms_navigation_menu_nav() ?> | <?php do_action(‘icl_navigation_menu’); ?> | |
| Breadcrumbs trails | <?php cms_navigation_breadcrumb() ?> | <?php do_action(‘icl_navigation_breadcrumb’); ?> | |
| Sidebar | <?php cms_navigation_page_navigation() ?> | <?php do_action(‘icl_navigation_sidebar’); ?> |
* Tip: use some sort of search to locate all instances. Sometimes, the navigational elements are added to more than one file in the theme.
Once you’ve done this, your website will still display fine, just without the CMS navigation elements. the do_action calls will either produce the correct output (if WPML is activated) or return quietly without raising any PHP errors (if WPML is still not active).
Swap the CMS Navigation plugin with WPML
Deactivate the CMS Navigation plugin. WPML will refuse to activate while the older plugin is active.
Get the recent version of WPML from its WordPress plugins repository page and unzip in your plugins directory (you can also have WordPress auto-install it, just search for WPML). Activate WPML and you’re done.
English
Deutsch
Español