Skip to content

Instantly share code, notes, and snippets.

@elchele
Last active August 17, 2018 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elchele/0cecd44a778904e6cd2bb32b3b14abf2 to your computer and use it in GitHub Desktop.
Save elchele/0cecd44a778904e6cd2bb32b3b14abf2 to your computer and use it in GitHub Desktop.
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