Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Custom List Actions do not appear #36

Open
marvoh opened this issue Jan 25, 2019 · 2 comments
Open

Custom List Actions do not appear #36

marvoh opened this issue Jan 25, 2019 · 2 comments

Comments

@marvoh
Copy link

marvoh commented Jan 25, 2019

Subject

Thank you for the beautifully done admin theme for the beloved Sonata, this gives it a fresh lease of line.

I had a custom list action in my "vanilla" Sonata Admin that would appear next to the edit / show / delete buttons. I see you've come up with nifty ways for the three. However, the custom button doesn't appear.

Here's what I have in my Admin

`protected function configureListFields(ListMapper $listMapper)
{
    $listMapper
      ->addIdentifier('name')
      ->add('dateOfIncoporation')
      ->add('contactPerson')
      ->add('contactDesignation')
      ->add('contactEmail')
      ->add('contactTelephone')
      ->add('_action', null, array(
          'actions' => array(
              'show' => array(),
              'edit' => array(),
              'delete' => array(),
              'statement' => array(
                'template' => 'Admin/CRUD/list__action_statement.html.twig'
              ),
          )
      ));
}`

And have the following code in my list__action_statement.html.twig file

`<a class="btn btn-sm btn-default statement" href="#" data-id="{{ object.id }}" data-client="{{ object.name }}">Statement</a>`

The statement button doesn't appear in the list

@marvoh
Copy link
Author

marvoh commented Jan 30, 2019

Not to worry, I fixed this

@ceesvanegmond
Copy link
Contributor

@marvoh How did you fixed it? Maybe do a pull request? Thx!

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

No branches or pull requests

2 participants