Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function: per page components.
#17
crusher88 Wrote:Thanks! This made life easier since I basically want to have different sidebar content on each page.

Is there any way of combining this function with the i18n plugin?
http://get-simple.info/extend/plugin/i18n/69/?

You could of course change the component master function to behave "I18Nily".

Or you can use Chris' way to do it, where you can replace get_component with get_i18n_component.

Or you can do it like this (example for additional language German):
  • Install the I18N CustomFields plugin
  • Create your sidebar components, e.g. "sidebar1", "sidebar1_de", "sidebar2", "sidebar2_de", ...
  • Goto Plugins/Configure I18N Custom Fields and add a field named "sbcomp", text "Sidebar", type "dropdown" and enter an empty line and all possible sidebars below the type, e.g.
Code:
sidebar1
sidebar2
  • Edit each page which should have a custom sidebar component and select the corresponding component from the list, then save.
  • Include the following code in your template:
Code:
<?php get_i18n_component(return_custom_field('sbcomp') ? return_custom_field('sbcomp') : 'sidebar'); ?>
This assumes that you have a standard sidebar component "sidebar" (and "sidebar_de") that you want to display, if the custom field is not set.

The advantage to Zegnat's approach is that you can use a component for multiple pages, a disadvantage might be that you have to select the sidebar component per page.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
Function: per page components. - by Zegnåt - 2009-10-31, 23:37:48
Function: per page components. - by GetSimple.RU - 2009-11-13, 22:11:24
Function: per page components. - by Zegnåt - 2009-11-14, 23:43:17
Function: per page components. - by focoves - 2009-12-15, 06:53:28
Function: per page components. - by Zegnåt - 2009-12-15, 06:58:50
Function: per page components. - by tyee - 2010-02-10, 12:50:10
Function: per page components. - by tyee - 2010-02-10, 14:26:47
Function: per page components. - by Origin - 2010-05-20, 02:17:03
Function: per page components. - by jasonbill - 2010-10-12, 22:41:05
Function: per page components. - by Zegnåt - 2010-10-13, 01:36:32
Function: per page components. - by quite_me - 2010-11-19, 21:07:46
Function: per page components. - by Zegnåt - 2010-11-20, 00:20:20
Function: per page components. - by quite_me - 2010-11-20, 00:39:26
Function: per page components. - by vladislav - 2011-04-13, 21:40:00
Function: per page components. - by Oleg06 - 2011-04-13, 23:36:23
Function: per page components. - by crusher88 - 2011-05-16, 22:20:17
Function: per page components. - by mvlcek - 2011-05-17, 01:19:35
Function: per page components. - by crusher88 - 2011-05-17, 04:47:59



Users browsing this thread: 1 Guest(s)