Benaesan

About me: Web Developer, interested in new technologies.
Location:

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • Benaesan replied on the discussion topic Problem with notification url
    Hello,  Sorry for the delay, I've been on a big project and I didn't take time for respond. So after some experiment All of this work. But in a first time the link within the notification doesn't work. I've had to add... view reply
  • Benaesan replied on the discussion topic Customize Topbar menu
    Yeah thanks that works fine. I've just found this method too: $item = elgg_get_menu_item('topbar', 'messages'); if ($item) { $item->setText(elgg_echo('dashboard'));... view reply
  • Benaesan replied on the discussion topic Customize Topbar menu
    Ok thanks, that works for profile and messages but not for Friends.  That not really simple to make a theme in Elgg. It's a pity that's not standardized for all the menu items.   view reply
  • Benaesan replied on the discussion topic Customize Topbar menu
    In the better case I want to remove all the elements, so I can reorder and add some css classes on them, without breaking the menu mecanism.  for example, the dashboard or site_notifications, can be remove, but that doesn't work with... view reply
  • Benaesan added a new discussion topic Customize Topbar menu in the group Theme Development
    Hello everyone,  I'll desperately try to personallze the topbar menu in Elgg 2.3.3. I've tryed to use the elgg_unregister_menu_item to remove element from the topbar like the documentation says to do, but that doesn't seem to...
    • but not for Friends

      Then override _elgg_friends_page_setup:

      elgg_unregister_event_handler('pagesetup', 'system', '_elgg_friends_page_setup');
      
      elgg_register_event_handler('pagesetup', 'system', 'my_friends_page_setup');
      
      function my_friends_page_setup() {
          $owner = elgg_get_page_owner_entity();
          $viewer = elgg_get_logged_in_user_entity();
      
          if ($owner) {
              $params = array(
                  'name' => 'friends',
                  'text' => elgg_echo('friends'),
                  'href' => 'friends/' . $owner->username,
                  'contexts' => array('friends')
              );
              elgg_register_menu_item('page', $params);
      
              $params = array(
                  'name' => 'friends:of',
                  'text' => elgg_echo('friends:of'),
                  'href' => 'friendsof/' . $owner->username,
                  'contexts' => array('friends')
              );
              elgg_register_menu_item('page', $params);
          }
      }
    • Yeah thanks that works fine.

      I've just found this method too:

       $item = elgg_get_menu_item('topbar', 'messages');
              if ($item) {
                  $item->setText(elgg_echo('dashboard'));
                  $item->setPriority(200);
                  $item->setSection('default');
              }
      
      

      So I can manipulate the menu item without breaking the standard mecanism.

      But seem to doesn't work with all, 

    • There is a menu hook intended just for this:

      // register with higher priority so it's called after all other hooks
      elgg_register_plugin_hook_handler('register', 'menu:topbar', 'modify_topbar_menu', 1000);
      
      function modify_topbar_menu($hook, $type, $return, $params) {
         
         $remove = ['friends'];
      
         foreach ($return as $key => $item) {
            /* @var $item \ElggMenuItem */
      
            if (in_array($item->getName(), $remove) {
                unset($return[$key]);
                continue;
            } 
      
            switch ($item->getName()) {
                case 'profile' :
                $item->setText('Profile');
                $item->setPriority(200);
                break;
            }
      
            $return[$key] = $item;
         }
      
         return $return;
      
      }
      

       

       

  • Benaesan joined the group Theme Development
  • Benaesan replied on the discussion topic Disable fontawesome
    Wow, Thanks a lot. But the RvR way is a little bit too much,  I need some icons (social networks, etc.) I'll check this. that was exactly what i'm looking for. Have a good day view reply
  • Benaesan added a new discussion topic Disable fontawesome in the group Beginning Developers
    Hello everyone, I've a problem with fontawesome. I have to migrate a custom theme that work fine with Elgg 1.10 to Elgg 2.3. But Icons are duplicate and stacked. This theme have image as icons, and there is a fontawesome character on...