
Purpose:
You can define different fields called "roar specific post data" which will be displayed in advanced tab in entry editor. This way you give your editors ability to save some extra data beside the article. Developers can use this data in code for simple output for example or as a condition for outputting something hardcoded in template.
[rebelmouse-proxy-image https://media.rbl.ms/image?u=%2Fmedia.forumbee.com%2Fi%2F42084473-c46d-44b1-8846-8cdd97c43211%2F547.png&ho=https%3A%2F%2Fs3-us-west-2.amazonaws.com&s=535&h=ecfceba7fcdab3d6648b57f3e398f0e1a332127fba1fbe755e272162ad440d04&size=980x&c=4093561224 crop_info="%7B%22image%22%3A%20%22https%3A//media.rbl.ms/image%3Fu%3D%252Fmedia.forumbee.com%252Fi%252F42084473-c46d-44b1-8846-8cdd97c43211%252F547.png%26ho%3Dhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%26s%3D535%26h%3Decfceba7fcdab3d6648b57f3e398f0e1a332127fba1fbe755e272162ad440d04%26size%3D980x%26c%3D4093561224%22%7D" expand=1]
Type:
Optional.
Example:
'roar_specific_post_data': { 'video_caption': { 'title': 'Video Caption' }, 'video_credit': { 'title': 'Video Credit' }, },
Usage:
When enabled and filled in there will be extra roar_specific_post_data property in Bootstrap object. There will be as many properties as you have fields.
[rebelmouse-proxy-image https://media.rbl.ms/image?u=%2Fmedia.forumbee.com%2Fi%2F6f629346-179e-4b6b-8e32-811f524ddbea%2F547.png&ho=https%3A%2F%2Fs3-us-west-2.amazonaws.com&s=243&h=aa9bc116b14bc1a50fa890eff013a31129a602d467436b6bc0cef5812e18d558&size=980x&c=240992599 crop_info="%7B%22image%22%3A%20%22https%3A//media.rbl.ms/image%3Fu%3D%252Fmedia.forumbee.com%252Fi%252F6f629346-179e-4b6b-8e32-811f524ddbea%252F547.png%26ho%3Dhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%26s%3D243%26h%3Daa9bc116b14bc1a50fa890eff013a31129a602d467436b6bc0cef5812e18d558%26size%3D980x%26c%3D240992599%22%7D" expand=1]
In mustache (used on postpage) would code look like this:
{{#roar_specific_data.video_caption}} <div class="widget__video_caption"> {{roar_specific_data.video_caption}}</p> </div>{{/roar_specific_data.video_caption}}
First we check if video caption exists and if does then we output it.
Important:
Roars by default doesn't have code to render this extra fields in advanced tab in dashboard. Make sure that you have this line of code:
{% if post_extra_fields %}settings.post_extra_fields= {{post_extra_fields|to_json|safe}};{%endif%};
in editor.html file:
engine/roar_name/templates/dashboard/editor.html