wearejust / sonata-theme-bundle

A custom theme for a Sonata project
https://wearejust.com
MIT License
4 stars 0 forks source link

Custom List Actions do not appear #36

Open marvoh opened 5 years ago

marvoh commented 5 years ago

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 commented 5 years ago

Not to worry, I fixed this

ceesvanegmond commented 5 years ago

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