0

i am new to salesforce lightning. kindly let me know what is the issue that this code is not working. Actually i copied it from the link:- https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_config_for_builder_theme_layout.htm with slight modifications. Now when i click on the preview portion of Lightning app nothing is coming. I need the search,navigation and header portion of community which i am not able to get. Might b i have to upload the component in Lightning App builder in order to make it visible. kindly let me know is there any prerequisite in lightning communities before previewing the app made.

------------Component code:------------------------------

<aura:attribute name="search" type="Aura.Component[]" required="false"/>

<aura:attribute name="profileMenu" type="Aura.Component[]" required="false"/>

<aura:attribute name="navBar" type="Aura.Component[]" required="false"/>

<aura:attribute name="newHeader" type="Aura.Component[]" required="false"/>
 <aura:attribute name="blueBackground" type="Boolean" default="false"/>

<aura:attribute name="smallLogo" type="Boolean" default="false" />
<ui:inputCheckbox label="check"/>
<div>

    <div class="searchRegion">

        {!v.search}

    </div>

    <div class="profileMenuRegion">

        {!v.profileMenu}

    </div>

    <div class="navigation">

        {!v.navBar}

    </div>

    <div class="newHeader">

        {!v.newHeader}

    </div>
    <div class="mainContentArea">

        {!v.body}

    </div>

</div>

------------ design code:---------------------

<design:attribute name="blueBackground" label="Blue Background"/>

<design:attribute name="smallLogo" label="Small Logo"/>

-----------------style code:---------------------------------

.THIS{
    position: relative;
    z-index: 1;
}

Right now i am only getting checkbox. I am expecting Navigation,header and search portion also.

1

so by default Napili communities come with default theme and content layout. You can chose one of those default templates and create a Napili page and once the page is created, In the left hand side palette you would see custom components. Any component you create will come up in that list as long as the component implements the below interface

<aura:component implements="forceCommunity:availableForAllPageTypes">

All you need to do is drag and drop the component in the page and preview it and it will show contents of your component. If you need to publish it to community users click the publish button on the right top and it will be available to all community users.

1

Actually the code you have copied is to create a theme layout. Lightning community has 2 kinds of layouts 1.Content Layout 2.Theme Layout What you are trying to create is a theme layout which will be kind of common for multiple pages. By creating four attributes of type aura:component you have created 4 facets for which you can set content .

The same link you have used in your question shows how a lightning page is segregated. So you would have a content layout in which you would place your components to give the desired functionality.

Are you trying to create a lightning component or a theme layout?

2
  • @RedDevil--thanks for the response. Actuaaly i am trying to open a lightning app in communities. that community can be standard and cutomised also,depending on the requirement. So, if i have made any component ,how to access it in lightning communities. Do i have to create a content layout as mentioned by you. Or shall i have to write the code for that in lightning component. O is there any standard way to do that. Please help me with the navigation,if possible. – vineet Apr 21 '17 at 6:17
  • so by default the Napili communities they come with default theme and content layout. You can chose one of those default templates and create a Napili page and once the page is created in the left hand side palete you would see custom components. Any component you create will come up in that list as long as the component implments the below interface – RedDevil Apr 22 '17 at 11:48

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.