# CoreEvents inherit VIEW\_INJECT\_CUSTOM\_CONTENT for creating a filter option in Campaigns

**URL:** <https://forum.mautic.org/t/coreevents-inherit-view-inject-custom-content-for-creating-a-filter-option-in-campaigns/16316>\
**Category:** Product Support\
**Created:** [September 28, 2020, 2:10pm UTC](https://forum.mautic.org/t/coreevents-inherit-view-inject-custom-content-for-creating-a-filter-option-in-campaigns/16316 "2020-09-28T14:10:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gayathri612](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gayathri612/32/838_2.png) [@gayathri612](https://forum.mautic.org/u/gayathri612)\
**Post date:** [September 28, 2020, 2:10pm UTC](https://forum.mautic.org/t/coreevents-inherit-view-inject-custom-content-for-creating-a-filter-option-in-campaigns/16316/1 "2020-09-28T14:10:30Z")

</div>

I need to create a filter in Campaigns page using mautic CoreEvent, VIEW\_INJECT\_CUSTOM\_CONTENT / VIEW\_INJECT\_CUSTOM\_BUTTONS. With that note, need to design a dropdown button. There is no available samples or plugins which overrides existing functionality.  
I created a EventListener with name  
`'class CustomContentSubscriber extends CommonSubscriber'`  
where the event is called from getSubscribedEvents() calling a function

> CoreEvents::VIEW\_INJECT\_CUSTOM\_CONTENT =\> [‘getContentInjection’, 0],

> public function getContentInjection(CustomContentEvent $event)  
> {  
> switch ($event-\>getViewName()) {  
> case ‘MauticCampaignBundle:Campaign:list.html.php’:  
> switch ($event-\>getContext()) {  
> $event-\>addTemplate(‘MauticCampaignTestBundle:Campaign:export.html.php’);  
> }  
> break;  
> }  
> }  
> View page:
> 
> Dropdown button 
> Action  
> Another action

This doesnt populate the dropdown in the required place. Near contacts source filter in campaigns page. Can someone help in this aspect?
