Trying to change the buttons to plain links in profile owner block

adc
By adc

hi all. I am trying to change the ugly buttons in the profile owner block to links (like the links below the buttons) but I cannot seem to do it. Been into profile plugin owner block & tried to change the class but had no luck. Can anyone help please?

  • adc

    Working in profile plugin's owner_block.php trying to figure out the $profile_actions & get them to display like the $content_menu. 

  • $profile_actions = '';
    if (elgg_is_logged_in() && $actions) {
        $profile_actions = '<ul class="elgg-menu elgg-menu-owner-block profile-content-menu elgg-menu-owner-block-default">';
        foreach ($actions as $action) {
            $item = elgg_view_menu_item($action, array());
            $profile_actions .= "<li class=\"{$action->getItemClass()}\">$item</li>";
        }
        $profile_actions .= '</ul>';
    }

  • I wouldn't change the profile plugin itself. Like RvR says it should be in your own plugin.

    Some people have a "my-customisations" plugin, which they use to keep all their changes in one place.

    I always work with my own theme so personally I put all of these little changes in my theme.

    eg. I have EasyTheme2 active atm so I copied the file across to "mod/easytheme2/views/default/profile/owner_block.php" and worked on it there.

     

  • adc

    Thanks, this made a change, but not the correct one. I am trying to change the profile action menu so the links don't appear as buttons but as links. I will pay anyone who can figure this out.

  • @adc Just do it:

    $profile_actions = '';
    if (elgg_is_logged_in() && $actions) {
        $profile_actions = '<ul class="elgg-menu profile-action-menu mvm">';
        foreach ($actions as $action) {
            $item = elgg_view_menu_item($action, array('class' => 'your-own-class'));
            $profile_actions .= "<li class=\"{$action->getItemClass()}\">$item</li>";
        }
        $profile_actions .= '</ul>';
    }

  • adc

    My own class!? Just need these as normal links, like content menu lol. Like I said, I will pay.

  • So what change did it make?

    You said:

    I am trying to change the ugly buttons in the profile owner block to links (like the links below the buttons)

    The code I gave you should make it should look like this...

    (but with your own colours)

  • I guess you might be using a theme that has added extra classes to the content menu links?

    If so, all I did was find the <ul> classes for the 'content menu' and used them for the 'profile action' section.

  • adc

    Thank you both a billion times. I eventually found my error in that it was indeed 2 other plugins overriding the settings. Your patience & understanding is greatly appreciated.