Setup SonataNewsBundle to handle media in posts

微笑、不失礼 提交于 2019-12-12 04:48:07

问题


Installed both SonataMediaBundle, SonataNewsBundle and SonataAdminBundle (and much more but these matter).

When posting a news item via the admin I choose to use the markdown configured as bellow.

sonata_formatter:
    formatters:
        markdown:
            service: sonata.formatter.text.markdown
            extensions:
                - sonata.formatter.twig.control_flow
                - sonata.formatter.twig.gist
                - sonata.media.formatter.twig   

The formatter formats all titles etc. as expected however, media are not formatted. Though, I found some different document about the syntax non of them where parsed.

Formats found:

<% 1552362, 'gistfile1.txt'%>

<% media 4, 'small' %>
{% thumbnail 4, 'small' %}

So.

  1. I could be wrong on the syntax
  2. Some extra configuration is needed
  3. Some custom coding needs to be done
  4. Something should be done at the front end?
  5. Or I am really missing something?

回答1:


<% media 4, 'small' %> works correctly, however, you should make sure that your cache is cleared!



来源:https://stackoverflow.com/questions/10562850/setup-sonatanewsbundle-to-handle-media-in-posts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!