2011-06-01, 01:43:33
I18N version 1.5.2 fixes a bug in get_i18n_content.
The functions get_i18n_content and get_i18n_component now return true if the page or component was found. You can use this to display a default content, if no content was output.
Example: a page might have a custom sidebar, which is stored in the component sidebar-slug, where slug is the slug of the current page. If there is no custom sidebar, display the component sidebar:
Example: a page might have a custom sidebar, which is stored in the content of page slug-sidebar (this way you have a WYSIWYG editor), where slug is the slug of the current page. If there is no custom sidebar, display the component sidebar:
The functions get_i18n_content and get_i18n_component now return true if the page or component was found. You can use this to display a default content, if no content was output.
Example: a page might have a custom sidebar, which is stored in the component sidebar-slug, where slug is the slug of the current page. If there is no custom sidebar, display the component sidebar:
Code:
<?php get_i18n_component('sidebar-'.return_page_slug()) || get_i18n_component('sidebar'); ?>
Example: a page might have a custom sidebar, which is stored in the content of page slug-sidebar (this way you have a WYSIWYG editor), where slug is the slug of the current page. If there is no custom sidebar, display the component sidebar:
Code:
<?php get_i18n_content(return_page_slug().'-sidebar') || get_i18n_component('sidebar'); ?>