2017 © Pedro PelĂĄez
 

symfony-bundle media-bundle

The media bundle of the symfony-unifik distribution

image

unifik/media-bundle

The media bundle of the symfony-unifik distribution

  • Monday, May 15, 2017
  • by tiois
  • Repository
  • 8 Watchers
  • 1 Stars
  • 535 Installations
  • JavaScript
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 6 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

UnifikMediaBundle

Installation

Using composer file :, (*1)

"require": {
    //...,
    "unifik/media-bundle": "dev-master"
},

Add the following line to AppKernel.php :, (*2)

new Unifik\MediaBundle\UnifikMediaBundle(),

In app/config/routing.yml add the following:, (*3)

unifik_media_backend:
    resource: "@UnifikMediaBundle/Resources/config/routing_backend.yml"
    prefix:   /admin/media

To activate the media manager with CKEditor once the bundle is loaded, you must register the plugin in the ckeditor config (app/config/config.yml):, (*4)

external_plugins:
    unifikmediamanager:
        path: bundles/unifikmedia/backend/js/ckeditor/plugin/unifikmediamanager

You must also add the 'Insert_media' button in one toolbar. An example of config:, (*5)

trsteel_ckeditor:
  toolbar_groups:
      [...]
      insert: ['Insert_media', 'Image', 'Flash', 'Table', 'HorizontalRule']
      [...]

To get the proper media select field in your form, your need to add those lines in your form theme:, (*6)

{% block media_select_widget %}
    {% include 'UnifikMediaBundle:Backend/Form:fields.html.twig' with {'widget_attributes': block('widget_attributes')} %}
{% endblock %}

This bundle use FOSRoutingBundle. So you need to include the following js files:, (*7)

{% javascripts
    'bundles/fosjsrouting/js/router.js'
    'js/fos_js_routes.js'
%}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}

And run this command: app/console fos:js-routing:dump, (*8)

Include the dynamic_loader.js file required to add the Media Bundle CKEditor Plugin:, (*9)

{% javascripts
    '@UnifikMediaBundle/Resources/public/backend/js/dynamic_loader.js'
%}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}

Include the liip imagine routing in your config.yml file:, (*10)

_liip_imagine:
    resource: "@LiipImagineBundle/Resources/config/routing.xml"

Bundle requirements

  • unifik/doctrine-behaviors-bundle
  • liip/imagine-bundle
  • friendsofsymfony/jsrouting-bundle

Add Media field

To link media with entity, add the manyToOne relation as follow:, (*11)

manyToOne:
  myMedia:
    targetEntity: Unifik\MediaBundle\Entity\Media

To generate de media field, add this in your form type: (default type is image), (*12)

->add('image2', 'media_select')

To choose an other media type: (available types are: image, video, embedvideo and document), (*13)

->add('image2', 'media_select', array('type' => 'image'))

The Versions

15/05 2017

0.1.x-dev

0.1.9999999.9999999-dev https://github.com/unifik/symfony-unifik

The media bundle of the symfony-unifik distribution

  Sources   Download

MIT

The Requires

 

by Hubert Perron
by Pascal Lapointe
by Émilie Marchand
by Jean-François CÎté
by Yanick Ouellet

cms media unifik

15/05 2017

0.1.1

0.1.1.0 https://github.com/unifik/symfony-unifik

The media bundle of the symfony-unifik distribution

  Sources   Download

MIT

The Requires

 

by Hubert Perron
by Pascal Lapointe
by Émilie Marchand
by Jean-François CÎté
by Yanick Ouellet

cms media unifik

15/05 2017

dev-master

9999999-dev https://github.com/unifik/symfony-unifik

The media bundle of the symfony-unifik distribution

  Sources   Download

MIT

The Requires

 

by Hubert Perron
by Pascal Lapointe
by Émilie Marchand
by Jean-François CÎté
by Yanick Ouellet

cms media unifik

16/11 2015

dev-new-design

dev-new-design https://github.com/unifik/symfony-unifik

The media bundle of the symfony-unifik distribution

  Sources   Download

MIT

The Requires

 

by Hubert Perron
by Pascal Lapointe
by Émilie Marchand
by Jean-François CÎté
by Yanick Ouellet

cms media unifik

20/05 2015

0.1

0.1.0.0 https://github.com/unifik/symfony-unifik

The media bundle of the symfony-unifik distribution

  Sources   Download

MIT

The Requires

 

by Hubert Perron
by Pascal Lapointe
by Émilie Marchand
by Jean-François CÎté
by Yanick Ouellet

cms media unifik

12/07 2013

dev-twig-template

dev-twig-template https://github.com/egzakt/symfony-egzakt

The media bundle of the symfony-egzakt distribution

  Sources   Download

MIT

The Requires

 

by Hubert Perron
by Émilie Marchand
by Jean-François CÎté
by Yanick Ouellet

cms media egzakt