Skip to content

mrkushalsharma/symfony-mediaManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A Symfony 4 Media Manager

**Basic Usage**

In your routes.yaml file add,

media_manager:
  resource: "@MrkushalSharmaMediaManagerBundle/Resources/config/routing.yaml"
  prefix:   /

In your twig.yaml file, add

paths:
    '%kernel.project_dir%/vendor/mrkushalsharma/symfony-media-manager/src/Templates': MrkushalSharma

Create a Directory inside public folder name uploads and inside upload directory create media and inside it create 3 media named large, medium and thumbnail.

Run command

bin/console asset:install

In your layout file also add css and script file

    <link href="{{ asset('bundles/mrkushalsharmamediamanager/css/dropzone.css') }}" rel="stylesheet" type="text/css"></link>
    <link href="{{ asset('bundles/mrkushalsharmamediamanager/css/style.css') }}" rel="stylesheet" type="text/css"></link>

    <script src="{{ asset('bundles/mrkushalsharmamediamanager/js/dropzone.js') }}"></script>
    <script src="{{ asset('bundles/mrkushalsharmamediamanager/js/bootbox.js') }}"></script>
    
    <script src="{{ asset('bundles/mrkushalsharmamediamanager/js/common.js') }}"></script>
    or {% include 'MrkushalSharma/Scripts/commonJs.html.twig' %}

    <script src="{{ asset('bundles/fintechmediamanager/js/media.js') }}"></script>
    or  {% include '@Fintech/Scripts/mediaJs.html.twig' %}

Basic Example

  <a href="#"  data-popup="tooltip" class="changeCover" data-original-title="Click here to upload image" class="cursor-pointer btn bg-fn-pink" >change</a>
  
$('.changeCover').fnMediaModal({
    onSuccess(res,_self){            
    
    }
});

for CKEditor : onclick="insertCkeditorImage(this,'post_description')

``` Add Media ```

Input type example : onclick="insertImageUrl(this, 'featuredImage')"

``` ```

to List Media : fn_media_list or /media/list

to List Media : fn_media_list or /media/list

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published