Joomla — find all translations of a menu item

亡梦爱人 提交于 2019-12-08 00:05:44

问题


I am using Joomla 2.5 with the Language-Switcher Module and Plugin to built an multilingual site.

The main problem is: switching the language always leads to the translated homepage, but not to the translated menu-item., so I ran into the problem to find all translations of an Menu item.

Based on the internal Structure, the Language-filter only filters the page items with suitable language settings. So each menu item, or link, or url is unique and it is not possible to define something like a 'root' menu item for every translated menu item. Is it possible to create a Plugin that inserts a new button in the menu-item-creation-form?

Greeting philipp


回答1:


Got it Working! Searching for "translations" did not lead to proper results, instead searching for "associations" solved it. I found the answer while looking into code of the com_menus files where is written:

$associations = MenusHelper::getAssociations( $active->id );

That's all, I just needed to register the MenusHelper class via:

JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php');


来源:https://stackoverflow.com/questions/11948218/joomla-find-all-translations-of-a-menu-item

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!