sonata-project / SonataNewsBundle

[Abandoned] Symfony SonataNewsBundle
https://docs.sonata-project.org/projects/SonataNewsBundle
MIT License
151 stars 131 forks source link

Thumbnails for news articles? Missing translation!? #63

Closed ghost closed 12 years ago

ghost commented 12 years ago

How to add a media entry (image) to a post?

It seems that the bundle was ment to work with SonataMediaBundle and include thumbnails of images we could upload to an article / post, but I cant seem to find such functionality in the admin panel, nor in any of the twig templates for that matter.

Also I would like to point that, in my case at least, there is quite a big chunk of missing translation (even in english), am I using the wrong branch (2.0) again or what!?

edwines commented 12 years ago

You need to add the image when you create the entry... and then, edit the template to show the image with something like this:

{% thumbnail post.image, 'big'  %}
roelveldhuizen commented 12 years ago

So, you can only add images directly linked to the post but not add images within the post's text. Like this:

Bla bla bla
<img ...>
Bla blabla
<img ..>
Bla bla bla
``
edwines commented 12 years ago

Yes, that's the way it works... of course you can add images tag inside the content, but you need to go to the media and see the URL.

I use a tag system to add the image inside the content... something like this:

bla bla bla bla
[my_img]
blabla bla

Then, when the post is being rendered, some script replace the [my_img] tag for the image of the post... but only work with one image.

It would be great to have some system to easily add media objects... any idea?

roelveldhuizen commented 12 years ago

I think a tinymce kind of interface is needed to both make using the normal markup easier aswell inserting images. When you add an image you should have an overview of all latest images and be able to easily search for older onces.

ghost commented 12 years ago

TinyMCE is more than easy to implement. You just need to activate the TinyMCE bundle for symfony and then add 'tinymce' class to each text field you wish to use it with.

roelveldhuizen commented 12 years ago

Yes, the only issue is that the standaard TinyMCE doesn't embed the a SonataMediaBundle gallery when inserting an image.

ghost commented 12 years ago

Yes, I believe you cannot that easily use image inside a TinyMCE text field. Still, they work perfectly next to each other: http://postimage.org/image/rsga229m5/

Here my text is rendered after the chosen image(s), so that's not a problem in my case.

rande commented 12 years ago

does not seems to be a bug