0

I'm trying to render the joomla.searchtools in the front end of a custom component.

I extended JModelList for my model, and I can see the list in the front end. Pagination works well.

But when in my template I add:

    echo JLayoutHelper::render('joomla.searchtools.default',
        array('view' => $this)
    );

I get an error message like this:

0 Call to a member function getGroup() on null

If I change the code above with:

<div class="btn-wrapper input-append">
    <input type="text" name="filter[search]" id="filter_search" value="" class="js-stools-search-string" placeholder="Search">
    <button type="submit" class="btn hasTooltip" title="" aria-label="Search" data-original-title="Search">
        <span class="icon-search" aria-hidden="true"></span>
    </button>
</div>

The search filter shows and works well.

What have I forgotten?

2

I had forgotten two lines in the view:

$this->filterForm    = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');

If someone is interested, here you can find a component example (com_buscador_site) that uses Joomla searchtools in Front End.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.