GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — SyliusCmsPlugin/doc/media.md at master · tulik/SyliusCmsPlugin

Expand file tree

/

media.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
55 lines (38 loc) · 1.83 KB
/

media.md

Copy path

File metadata and controls

55 lines (38 loc) · 1.83 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Media

In this plugin media represents a digital assets, for instance an image, a video or simple PDF file.

Currently, it supports following media types:

  • Image (img HTML tag)
  • Video (video HTML tag)
  • File (a HTML tag)

General usage

You can render media in three ways:

By rendering a media code template:

{{ bitbag_cms_render_media('media_code') }}

Rendering a media code directly:

{{ render(path('bitbag_sylius_cms_plugin_shop_media_render', {'code' : 'file', 'template' : '@App/Some/Template/_path.html.twig'})) }}

If you want to list media by specific section. Useful for displaying set of images. For example, using "gallery" section you can group set of images and display them as gallery, or even slider.

{{ render(path('bitbag_sylius_cms_plugin_shop_media_index_by_section_code', {'sectionCode' : 'gallery', 'template' : '@App/Some/Template/_path.html.twig'})) }}

Media provider

You can add your own media provider by adding a service with a tag named bitbag_sylius_cms_plugin.media_provider:

app.media_provider.audio:
    class: BitBag\SyliusCmsPlugin\MediaProvider\GenericProvider
    arguments:
        - "@bitbag_sylius_cms_plugin.media_uploader"
        - "@templating.engine.twig"
        - "@@BitBagSyliusCmsPlugin/Shop/Media/Show/audio.html.twig"
        - "media/audio"
    tags:
        - { name: bitbag_sylius_cms_plugin.media_provider, type: audio, label: bitbag_sylius_cms_plugin.ui.audio_provider }

Customization

If you don't know how to override templates yet, read Sylius template customization guide.

You can create a template under app/Resources/BitBagSyliusCmsPlugin/views/Shop/Media location. Available templates you can override can be found under this location.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.