We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

How to change look and style of widgets | Forum

Umair
Umair Mar 8 '15
I want to change the look and style of widgets on dashboard. Border, color etc. For example contact importer widget and similarly others
Nickolay
Nickolay Mar 14 '15
If you only need to modify CSS, then just edit base.css of your current there (you can do this manually or from admin panel http://yoursite.com/admin/CURRENT_THEME/css) - selectors that you'll need to add/modify can be easily detected using tools like FireBug for Firefox or Chrome Developers Tools (thought I think you have to know these already if you're going to do something with css:) ). And if html customization is needed, then currently it's only possible using a tiny hack I posted not so long ago: http://www.oxwall.org/forum/topic/31990
The Forum post is edited by Nickolay Mar 14 '15
Umair
Umair Mar 16 '15
ok thanks
Umair
Umair Mar 17 '15
Is it possible to add avatar in console area with the username?
Nickolay
Nickolay Mar 17 '15
You can do it like this:


class CMP_ConsoleAvatar extends OW_Component

{

    public function render()

    {

        $userId = OW::getUser()->getId();

        return '<a class="console-avatar" href="'.BOL_UserService::getInstance()->getUserUrl($userId).'"><img src="'.BOL_AvatarService::getInstance()->getAvatarUrl($userId).'"></a>';

    }

}


function console_add_avatar(BASE_CLASS_ConsoleItemCollector $event)

{

    if(OW::getUser()->isAuthenticated())

    {

        $item = new CMP_ConsoleAvatar();

        $event->addItem($item, 2);

    }

}


OW::getEventManager()->bind('console.collect_items', 'console_add_avatar');


Though avatar will be positioned before Username for admins and after it for simple users (unfortunately it cannot be fixed even by changing item order with additional check OW::getUser()->isAdmin() for now).

The Forum post is edited by Nickolay Mar 17 '15
Umair
Umair Mar 17 '15
Where to put it?
Nickolay
Nickolay Mar 17 '15

P.S. Moved the answer with attached plugin to your Avatar in header/console area thread, as it does not have any relation to initial question you've asked.

The Forum post is edited by Nickolay Mar 18 '15