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?

2
  • 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
    Commented Nov 20, 2017 at 22:31
  • @glls I have reloaded it multiple times and since yesterday. No luck yet. Commented Nov 20, 2017 at 22:43

1 Answer 1

10

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

1
  • 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? Commented Dec 18, 2019 at 18:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .