Adding Profile Action Links
The example below demonstrates how to add a profile action link to the Styleguide. To define your own profile action link, create your own label extension for the link's display label.
./custom/Extension/application/Ext/Language/en_us.addProfileActionLink.php
:
Fullscreen1234<?php//create the links label$app_strings['LNK_USERS_C'] = 'Users';
Next, create the profile action link extension ./custom/Extension/application/Ext/clients/base/views/profileactions/addProfileActionLink.php
:
Fullscreen1234567<?php$viewdefs['base']['view']['profileactions'][] = array('route' => '#Users','label' => 'LNK_USERS_C','icon' => 'sicon-link',);
Once you have created the extension files, navigate to Admin > Repair > Quick Repair and Rebuild. This will append your profile action item to the existing list of links.
Note: You may need to refresh the page to see the new profile menu items.
Removing Profile Action Links
To remove a profile action link, loop through the list of profile actions and remove the item by one of its properties. For your reference, the stock profile actions can be found in ./clients/base/views/profileactions/profileactions.php
.
./custom/Extension/application/Ext/clients/base/views/profileactions/removeProfileActionLink.php
:
Fullscreen12345678910<?phpif (isset($viewdefs['base']['view']['profileactions'])) {foreach ($viewdefs['base']['view']['profileactions'] as $key => $profileAction) {//remove the link by label keyif (in_array($profileAction['label'], array('LNK_ABOUT'))) {unset($viewdefs['base']['view']['profileactions'][$key]);}}}
Once you have created the extension files, navigate to Admin > Repair > Quick Repair and Rebuild. This will remove the profile action item from the existing list of links.
Note: You may need to refresh the page to see the profile menu items removed.