Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Show images and videos in excerpts
Hi, I was wondering if it's possible to preview also at least images, if not even videos embedded, in the discussion excerpt created by this plugin.
So that if a user posts a discussion with only an image and no text, on the frontpage it will be shown, and not only the title.
Is it possible or not? Thanks!
So that if a user posts a discussion with only an image and no text, on the frontpage it will be shown, and not only the title.
Is it possible or not? Thanks!
0
Comments
echo Wrap(SliceString(strip_tags($Sender->EventArguments['Discussion']->Body),$TrimSize), 'div', array(
to this
echo Wrap(SliceString($Sender->EventArguments['Discussion']->Body,$TrimSize), 'div', array(
I also altered the css file to center the image by adding
div.ExampleDescription img { display: block; margin: 0 auto; max-width: 566px; max-height: 566px; }
I added in the max widths and heights so no images get too big (you might have to change the numbers to your own forums correct sizes).
To test this I simply added an image in through buttonbar and one through fileupload, remember that the length to trim the preview to includes that of the tag.
Didn't try embedding youtube video but should work.
Very helpful and it works great @clethrill. Thank you so much
This is exactly what I was looking for as well. Thank you @clethrill
Tried the method of @clethrill but it didn't work.. Does it only work with 2.1? Or am I overlooking something. Hope someone could help me out or point me at the right direction? Thank you!
Never mind. My bad!
Mistook automatic embed with HTML..