function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mạnh NguyễnMạnh Nguyễn 

can't use "language selection" in Experience Builder

 Experience Builder
User-added imageMy Code
<aura:component implements = "forceCommunity:themeLayout" extends="forceCommunity:navigationMenuBase" access = "global" description = "Login Theme">
    <ltng:require styles = "{!$Resource.Design + '/css/comm.css'}"/>
    
    <aura:attribute name = "search" type = "Aura.Component[]" required = "false"/>
    <aura:attribute name = "profileMenu" type = "Aura.Component[]" required = "false"/>
    <aura:attribute name = "language" type = "Aura.Component[]" required = "true"/>
    <aura:attribute name = "newHeader" type = "Aura.Component[]" required = "false"/>
    <aura:attribute name = "showSearch" type="Boolean" default="true" />


    <div class="landing-theme">        
        <div class="landing-header">
            
            <div class="header-logo">                
                <a href="javascript:void(0);" class="desktop-version">
                    <img src="{!$Resource.CommunityIcon + '/CommunityIcon/logo.png'}" onclick="{!c.goLoginMainPage}"/>                                        
                </a>
                
                <a href="javascript:void(0);" class="mobile-version">
                    <img src="{!$Resource.CommunityIcon + '/CommunityIcon/Logo-mobile.png'}" onclick="{!c.goLoginMainPage}"/>                                        
                </a>
            </div>

            <div class="header-contactus">                
                <a href="javascript:void(0);" class="text_h5 h5--OpenSans-Bold" onclick="{!c.goContactUsPage}">{!$Label.c.B2B_PublicContactUs}</a>                
            </div>

            <div class="header-language">
                <div class="header-language_icon">
                    <span class="slds-button slds-button_icon" tabindex="0" title="Language">
                        <lightning:icon class="left-world" iconName="utility:world" size="small" alternativeText="Language"/>
                    </span>
                </div>

                <div class="header-language_selection">
                    {!v.language}  
                </div>
            </div>

            <div class="header-search">
                <img src="{!$Resource.CommunityIcon + '/CommunityIcon/icon_global_search.png'}" alternativeText="search"/>
            </div>
        </div>
        <div class="landing-content">
            <div class="landing-body">
                {!v.body}
            </div>
    
            <div class="landing-footer">
                <c:B2B_Footer/>
            </div>
        </div>        
    </div>
</aura:component>


I can't add "language selection"  to language component (1) though before that i could ( For some reason I had to delete it ).

What do I need to do to use it ?

SwethaSwetha (Salesforce Developers) 
HI Manh,
I see that the code is of a custom lightning component. Are you trying to add the same? If so, are you not seeing it in the custom components section? Also, what is the type of community (napili?/customerPortal?..) Thanks.
Mạnh NguyễnMạnh Nguyễn

HI Swetha

My type community is Portal,


Step 1: I create an empty component with : 

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

And

<div class="header-language_selection">
     {!v.language}  
</div>

 

Here is the documentation about it : 

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_config_for_builder_theme_layout.htm?search_text=Aura.Component%5B%5D

 

Step 2: I want drag standard component "Language Selector" to empty component ( same my img ). but it not work.

 

SwethaSwetha (Salesforce Developers) 
HI Manh,
I tried with below snippet of lightning component and it works for me
<aura:component implements="forceCommunity:themeLayout" access="global" description="Sample Custom Theme Layout">
    <aura:attribute name = "language" type = "Aura.Component[]" required = "true"/>
    <div>
         <div class="header-language_selection">
          {!v.language}  
        </div>
    </div>
</aura:component>

Then, from community builder settings>Theme>"Configure" tab> added the above created Theme Layout Component.

Then from page properties> check the "Override the default theme layout for this page" checkbox >select the created themelayout

This has created a blank "Language(theme region)" and I was able to drag and drop my standard "language selector component" to it from the components list.

User-added image
Can you verify if you are doing anything differently from above steps? Happy to discuss in case of any follow-up queries. Thank you