cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the layout depending on the page loaded?

andreivasile_
Champ in-the-making
Champ in-the-making

I need to switch between two different layouts depending on the page displayed. For instance, the layout/theme below this paragraph is to be displayed on some pages only (please note the cell named "column" - holding 3 fragments - in section "nxMainContainer". That is to be hidden when certain pages are displayed - scroll down to check the alternative layout):

<theme name="customTheme1" template-engines="jsf-facelets">
    <layout>
        <page name="default" class="assetManagement">
            <section class="nxHeader">
                <cell class="content">
                    <!-- logo -->
                    <fragment type="generic fragment"/>
                    <!-- header -->
                    <fragment type="generic fragment"/>
                </cell>
            </section>
            <section class="nxMainContainer">
                <cell class="column">
                    <!-- dam search filters -->
                    <fragment type="generic fragment"/>
                    <fragment type="generic fragment"/>
                    <fragment type="generic fragment"/>
                </cell>
                <cell class="listingView">
                    <!-- dam filtered search results -->
                    <fragment type="region fragment"/>
                </cell>
            </section>
            <section class="nxFooter">
                <cell class="content">
                    <fragment type="generic fragment"/>
                </cell>
            </section>
        </page>
        <page name="popup">
            <section class="nxMainContainer">
                <cell class="content">
                    <!-- main area -->
                    <fragment type="region fragment"/>
                </cell>
            </section>
        </page>
    </layout>

Alternative layout (without cell "column")

<theme name="customTheme2" template-engines="jsf-facelets">
    <layout>
        <page name="default" class="assetManagement">
            <section class="nxHeader">
                <cell class="content">
                    <!-- logo -->
                    <fragment type="generic fragment"/>
                    <!-- header -->
                    <fragment type="generic fragment"/>
                </cell>
            </section>
            <section class="nxMainContainer">
                <cell class="listingView">
                    <!-- dam filtered search results -->
                    <fragment type="region fragment"/>
                </cell>
            </section>
            <section class="nxFooter">
                <cell class="content">
                    <fragment type="generic fragment"/>
                </cell>
            </section>
        </page>
        <page name="popup">
            <section class="nxMainContainer">
                <cell class="content">
                    <!-- main area -->
                    <fragment type="region fragment"/>
                </cell>
            </section>
        </page>
    </layout>

Thanx a ton

1 REPLY 1

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

What do call page ? a specific document ? or else... Can you tell me a bit more about the context when the first one is displayed and the context for the second one...