6

I have created a sample lightning home page template, but it is not listed when I try to create a home page.

Component:

<aura:component implements="lightning:homeTemplate" description="A single column with a background image">
    <aura:attribute name="main" type="Aura.Component[]" />
    <aura:handler name="init" value="{!this}" action="{!c.myAction}" />

    <div>
        <lightning:layout horizontalAlign="spread" verticalAlign="center">
            <lightning:layoutItem flexibility="grow">
                {!v.main}
            </lightning:layoutItem>
        </lightning:layout>
    </div>
</aura:component>

enter image description here Am I missing anything?

  • did you reload your page after creating the component and before creatinga new lightning page? if not, try reloading the page where you want to add the custom home page and retry. – glls Nov 20 '17 at 22:31
  • @glls I have reloaded it multiple times and since yesterday. No luck yet. – Saumya Ranjan Satapathy Nov 20 '17 at 22:43
9

From the documentation here you will need a design resource for this .A simple design resource for your scenario will look like below

<design:component label="A single column with a background image">
<flexipage:template >
    <!-- The default width for the "left" region is "MEDIUM". In tablets,
    the width is "SMALL" -->
        <flexipage:region name="main" defaultWidth="LARGE">
            <flexipage:formfactor type="LARGE" width="LARGE" />
        </flexipage:region>
   </flexipage:template>

Once you have a design resource you should be see that in custom components .enter image description here

  • I have built a lightning home page template and it is mostly working, but when I drop a Dashboard into it, the contents of the dashboard is not rendered. It only shows the title and link to view the dashboard, but not the contents of the dashboard. Is there something special I need to do to get the dashboard to display within the lightning homepage template? – Mike Paisner Dec 18 '19 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.