Skip to content

Instantly share code, notes, and snippets.

@lfreeland
Last active September 14, 2018 19:45
Show Gist options
  • Select an option

  • Save lfreeland/ac5d584f9cf4599dcd63e031b8ecbc0d to your computer and use it in GitHub Desktop.

Select an option

Save lfreeland/ac5d584f9cf4599dcd63e031b8ecbc0d to your computer and use it in GitHub Desktop.
Page Layout Record Display Lightning Component Markup
<aura:component controller="PageLayoutRecordDisplayController" implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:hasSObjectName">
<aura:attribute name="PageLayoutName" type="String" />
<aura:attribute name="PageLayout" type="Object" access="private" />
<aura:handler name="init" value="{!this}" action="{!c.init}" />
<div class="slds-box slds-theme_default">
<aura:if isTrue="{! v.recordId }">
<lightning:recordViewForm recordId="{! v.recordId }" objectApiName="{! v.sObjectName }">
<aura:iteration items="{! v.PageLayout.Sections }" var="section">
<c:CollapsibleSection title="{! section.Label }">
<div class="slds-grid slds-gutters">
<aura:iteration items="{! section.Columns }" var="column">
<div class="slds-col">
<aura:iteration items="{! column.Fields }" var="field">
<lightning:outputField fieldName="{! field.APIName }" />
</aura:iteration>
</div>
</aura:iteration>
</div>
</c:CollapsibleSection>
</aura:iteration>
</lightning:recordViewForm>
</aura:if>
</div>
</aura:component>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment