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

hide add new widget | Forum

Topic location: Forum home » Support » General Questions
Marcus
Marcus Jun 4 '19

Hi folks im trying to hide add new widget when user lands on sertain page.


public function hide_add_new_widjet(BASE_CLASS_EventCollector $event)


OW::getEventManager()->bind('base.add_new_content_item', array($this, "hide_add_new_widjet"));


in:


add_new_content.php


this code:


$event = new BASE_CLASS_EventCollector(self::EVENT_NAME);
        OW::getEventManager()->trigger($event);
        $data = $event->getData();
        if( empty($data) )
        {
            $this->setVisible(false);
            return;
        }
        $this->assign('items', $event->getData());
    }


if you add this:


$this->setVisible(false);


it will hide but how can i do it from my event_handler.

dave Leader
dave Jun 9 '19


This should be moved to custom coding.


In order to do this from your event handler you need to trap an event first, what event are you trying to trap?  Then see if there is a hook for that event and use that hook to set the value.  


Do you know where to look for established events in oxwall ?


Marcus
Marcus Jun 9 '19
Where should i look please