docs: def get_frontend_data_dict_for_placeholders(placeholders, request, editable=False):
      """
      Takes a list of placeholder instances and returns the data that is used by the frontend to render all contents.
      The returned dict is grouped by placeholder slots.
      """
      data_dict = {}
      for placeholder in placeholders:
          if placeholder:
              plugins = []
  
              # We don't use the helper method `placeholder.get_plugins()` because of the wrong order by path.
              placeholder_plugins = placeholder.cmsplugin_set.filter(language=request.LANGUAGE_CODE).order_by(
                  settings.DJANGOCMS_SPA_PLUGIN_ORDER_FIELD)
  
              for plugin in placeholder_plugins:
                  # We need the complete cascading structure of the plugins in the frontend. This is why we ignore the
                  # children here and add them later in the loop.
                  if not plugin.parent:
                      plugins.append(get_frontend_data_dict_for_plugin(
                          request=request,
                          plugin=plugin,
                          editable=editable)
                      )
  
              if plugins or editable:
                  data_dict[placeholder.slot] = {
                      'type': 'cmp-%s' % placeholder.slot,
                      'plugins': plugins,
                  }
  
              if editable:
                  # This is the structure of the template `cms/toolbar/placeholder.html` that is used to register
                  # the frontend editing.
                  from cms.plugin_pool import plugin_pool
                  plugin_types = [cls.__name__ for cls in plugin_pool.get_all_plugins(placeholder.slot, placeholder.page)]
                  allowed_plugins = plugin_types + plugin_pool.get_system_plugins()
  
                  data_dict[placeholder.slot]['cms'] = [
                      'cms-placeholder-{}'.format(placeholder.pk),
                      {
                          'type': 'placeholder',
                          'name': str(placeholder.get_label()),
                          'page_language': request.LANGUAGE_CODE,
                          'placeholder_id': placeholder.pk,
                          'plugin_language': request.LANGUAGE_CODE,
                          'plugin_restriction': [module for module in allowed_plugins],
                          'addPluginHelpTitle': 'Add plugin to placeholder {}'.format(placeholder.get_label()),
                          'urls': {
                              'add_plugin': placeholder.get_add_url(),
                              'copy_plugin': placeholder.get_copy_url()
                          }
                      }
                  ]
  
      return data_dict