Bug #23192 See Comments

Custom add-on: header search bar not displayed

Version: 3.5.10 Reporter: Louis D.

Hi there,

So I need to add a search bar to my add-on, just like there’s one on the template manager page.

Looking at the documentation, I see that I need to use that code:

ee()->cp->header = array(
  'title' => lang('template_manager'),
  'form_url' => ee('CP/URL')->make('design/template/search', array('return' => $return)),
  'toolbar_items' => array(
    'settings' => array(
      'href' => ee('CP/URL')->make('settings/template'),
      'title' => lang('settings')
    ),
  ),
  'search_button_value' => lang('search_templates')
);

This correctly adds a settings icon in front of the title. But it doesn’t display a search bar. I do remember this was working well in previous versions, although I can’t remember which one exactly.

I’m using that code to render the view

return array(
      'heading'   => lang('...'),
      'body'    => ee('View')->make('...:index')->render($vars),
      'breadcrumb'  => array(
       ee('CP/URL', 'addons/settings/...')->compile() => lang('..._module_name')
      ),
     );

Am I doing something wrong ?

  • You’re not doing something wrong, but there is a bug in the documentation.

    That search field isn’t allowed in individual modules. It’s meant to apply to entire sections.

    What should be used instead is the filter service, which indicates a search/filter within just the given table.

    See if that does the trick. And I’ll get that module documentation fixed up for the next release.

    Robin Sowell
    03rd August, 2017 at 5:25pm

You must be signed in to comment on a bug report.

ExpressionEngine News

#eecms, #events, #releases