subitolabs/terms-block-bundle

Display a terms aggregation as a block for Sonata block.

1.0.1 2018-03-05 15:30 UTC

This package is not auto-updated.

Last update: 2024-11-01 23:08:22 UTC


README

Do a select count(*), label group by label and display a block in Sonata admin dashboard.

Usage

composer require subitolabs/terms-block-bundle

In AppKernel.php

public function registerBundles() { $bundles = [ ... new \Subitolabs\Bundle\TermsBlockBundle\SubitolabsTermsBlockBundle() ... ] }

In sonata.yml

sonata_block:
    default_contexts: [admin]
    blocks:
    	...
      subitolabs.admin.block.terms:


sonata_admin:
	...
  dashboard:
      blocks:
          -
            position: left                       
            type:     subitolabs.admin.block.terms
            settings:
                text:  Suggested interest status
                admin_code:  admin.suggested_topic
                field: status
                term_label: formatStatus
                term_link: formatStatusAdminUrl