- Posts: 132
- Thank you received: 3
How to change menu item position
- alexmartin
-
Topic Author
- Offline
Less
More
2 years 5 months ago #360015
by alexmartin
How to change menu item position was created by alexmartin
Hi,
on the Control Panel left menu, i would like to reposition Download menu right below Customer Account menu - how can i do it?
I have lates Joomla 5 and Latest Hikashop
Image attached
on the Control Panel left menu, i would like to reposition Download menu right below Customer Account menu - how can i do it?
I have lates Joomla 5 and Latest Hikashop
Image attached
Please Log in or Create an account to join the conversation.
2 years 5 months ago #360016
by nicolas
Replied by nicolas on topic How to change menu item position
Hi,
You'll need to write custom PHP code in the file user / cpanel for your frontend template via the menu Display>Views.
Something like that at the beginning should do it:
This is based on this: stackoverflow.com/a/63329352
Note that I haven't tested it.
You'll need to write custom PHP code in the file user / cpanel for your frontend template via the menu Display>Views.
Something like that at the beginning should do it:
Code:
<?php
function repositionArrayElement(array &$array, $key, int $order): void
{
if(($a = array_search($key, array_keys($array))) === false){
return;
}
$p1 = array_splice($array, $a, 1);
$p2 = array_splice($array, 0, $order);
$array = array_merge($p2, $p1, $array);
}
repositionArrayElement($this->buttons, 'download', 1);
?>
This is based on this: stackoverflow.com/a/63329352
Note that I haven't tested it.
Please Log in or Create an account to join the conversation.
Time to create page: 0.179 seconds