I agree to the use of cookies in accordance with the Sourcefabric Privacy Policy.

Support our media development efforts

Please note: due to the quarantine measures required by the coronavirus outbreak, we are unable to answer the phone in our Prague office. Please send an email to contact@sourcefabric.org and someone will get back to you as soon as possible.

Who, what, when, where and why

Get the latest news about Sourcefabric software, solutions and ideas.

BACK TO BLOG OVERVIEW

Newscoop rich text image captions give editors more control

Rich Text Captions are fully implemented within Newscoop 4.3.2 I Photo from Death to Stock Photo
Rich Text Captions are fully implemented within Newscoop 4.3.2 I Photo from Death to Stock Photo

The rich text captions feature, already introduced in 4.2.1, has been ported to Newscoop 4.3. It's fully available at PR-860. With this feature, editors now have much more control with the images captions. Thos with image blogs pay attention, you could greatly profit from this feature!

In the System Preferences screen under the Editor Settings tab, you can enable this feature. The default is set to 'disabled'. Once enabled, it's also possible to set a character limit. For no character limit, set it to 0. Note that 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 this feature.

Article specific captions also benefit from this feature.

When it comes to templating, not all templates support captions by default, or they may not use the feature to the fullest. We recommended testing the feature with your templates and implementing corrections where needed. To help you adjust the templates, I'll provide a few examples below on 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 blog post 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 for our purposes, the caption. 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 cases where 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

Default themes assume the rich text caption setting is off, so be sure to 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.

BACK TO TOP