Rich text captions for images

The rich text captions feature, already introduced in 4.2.1, has been ported to Newscoop 4.3. It's fully available from PR-860. With this feature editors have much more control about the images captions and e.g. image blogs could greatly profit from this feature.

In the System Preferences screen under the tab Editor Settings it's possible to enable the feature. The default is disabled. Once enabled it's also possible to set a character limit, set it to 0 for no limit. Also all captions in Newscoop turn into rich text captions.

The already available permissions for the rich text editor in Newscoop have also been applied to this editor.

Article specific captions also benefit from the feature.

Article specific captions also benefit from the feature.

When it comes to templating not all templates might support captions by default, or they might not use the feature to it's fullest. So it's recommended to test the feature with your templates and do corrections where needed. To help you adjust the templates i'll give you a few examples below how to integrate the feature successfully.

There are two new functionalities in Smarty, getSystemPreference and wrap_in_element. The method getSystemPreference is available on the $gimme object, see this blogpost for more information. The function wrap_in_element can wrap a string in an html-element. It accepts three parameters, string, element and attributes. The attribute string represents the string to be wrapped, or better said caption in our case. The attribute element is the element in which to wrap the string. The attribute attributes is a string of attributes which will be applied to the element.

Captions with feature disabled

{{ $image->caption|strip_tags }}

It's advisable to always use strip tags, especially in case when Rich Text Captions have been enabled and used, since the system will not change your captions until you manually re-save them.

Captions with feature enabled

{{ $image->caption }}

Flexible templates

{{ if $gimme->getSystemPreference('MediaRichTextCaptions', 'N') == 'Y' }}
{{ wrap_in_element string=$image->caption element=div attributes='class="image-caption"' }}
{{ else }}

{{ $image->caption|strip_tags }}

{{ /if }}

Default Newscoop Themes

The default themes assume the rich text caption setting is off, so make the proper modifications when enabling this feature.

Slideshows can also make use of rich text captions.

Slideshows can also make use of rich text captions.