Skip to content

Instantly share code, notes, and snippets.

@elchele
Last active Aug 17, 2018
Embed
What would you like to do?
Custom Sidecar field component for displaying related data
{{!--
/* File: ./custom/clients/base/fields/related-info/detail.hbs
* Author: Angel Magaña -- cheleguanaco@cheleguanaco.com
* Date: August 17, 2018
*
* Description: Handlebars template for related info field component
*/
--}}
{{#each fields}}
<div class="fieldset-field">
{{fieldValue ../relatedData this}}
</div>
{{/each}}
@elchele
Copy link
Author

elchele commented Aug 17, 2018

After adding the field component, you need to reference it in the view metadata, as such:

            array(
            	'name' => 'related-info',
            	'type' => 'related-info',
            	'label' => 'LBL_RELATED_INFO',
            	'span' => 12,
            )

The above example is based off the Cases RecordView, for the default Accounts/Cases relationship.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment