Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'list' action hardcoded in base_list and base_links #4338

Closed
wodka opened this issue Feb 21, 2017 · 2 comments
Closed

'list' action hardcoded in base_list and base_links #4338

wodka opened this issue Feb 21, 2017 · 2 comments

Comments

@wodka
Copy link
Contributor

wodka commented Feb 21, 2017

Subject

I wanted to add "tabs" for different lists on the same admin. This works ok but I needed to copy some templates just to get it to work. Awesome would be if the links would actually use the action property if they refer to the same page.

Workaround

the files contain hardcoded 'list' references, I changed them to action:

  • CRUD/base_list.html.twig
  • Pager/base_links.html.twig

How did I add the lists?

The admin class got 2 separate routes:

    public function configureRoutes(RouteCollection $collection)
    {
        parent::configureRoutes($collection);

        $collection->add('listRequest');
        $collection->add('listOrder');
    }

and the controller 2 separate methods:

// fancyListAction uses the given action for the list
    public function listRequestAction()
    {
        return $this->fancyListAction('listRequest');
    }

    public function listOrderAction()
    {
        return $this->fancyListAction('listOrder');
    }

(I removed the additional filtering for results)

@OskarStark
Copy link
Member

sounds interesting to have an option to overwrite the default list route and add some tabs for different lists with (different filters and/or queries) ?

@stale
Copy link

stale bot commented Jan 30, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants