Closed Darknico closed 2 years ago
I decided it was easier to implement this feature into an existing plugin than to add new options to the mod itself :)
It is a good idea, I tested and work correclty :) Only a little suggestion:
In the navigation, use the old label
Should the new label be displayed there too?
For me, yes, it is more correct. The frontpage now I rename in "Home".
Does it make sense to you?
Ok, add this code to MainMenu.php:
public function frontCustomTemplate()
{
if (! empty($this->context['lp_main_menu_addon_portal_langs'][$this->user_info['language']]) && ! empty($this->context['linktree'][1]))
$this->context['linktree'][1]['name'] = $this->context['lp_main_menu_addon_portal_langs'][$this->user_info['language']];
}
Missing in the init the hook :)
add_integration_function('integrate_menu_buttons', __CLASS__ . '::frontCustomTemplate#', false, __FILE__);
work correctly
It is a portal hook, you shouldn't add it via add_integration_function. It is enough to add a hook name in the plugin file.
Sorry, I didn't understand where to add it. I'm not very experienced with hooks (and php knowledge is basic)
only add this function, not work
Is your feature request related to a problem? Please describe. (Опишите, зачем вам эта фича) No, it only is a suggestion
Describe the solution you'd like (Опишите желаемое решение) The possibility to change the label for Portal and Forum not by translation, but by setting in admin area, because each mod update, replace all customization for these labels