Landing page is the first page or screen that opens up once you log on to the application. Landing page can have an image or any workspaces. By default, Canvas Technology provides sample-landing-page as the default page that contains the icons of the workspaces.
...
The following table lists the properties of the landingPage configuration:
# | Attribute | Description | Sample Value |
---|---|---|---|
1 | enabled | True: Renders the landing page for the layout. | true |
2 | component | Component is a .JS file that holds the content of the landingPage. New component must be registered in the CLCR registry in the component.js file. | CARDMASTER |
Example:
In the following screenshot, the page which contain group of workspaces is the Landing Page.
Component code:
Code Block | ||
---|---|---|
| ||
landingPage : { enabled : true, component : 'utkarsh-sample-landing-page' }, |
Landing Page code:
Code Block | ||
---|---|---|
| ||
canvas.ns('canvas.applnlayout.utkarsh.landingpage'); /** *@namespace"canvas.applnlayout.card" *@descriptionThiscomponentiscurrentlyresponsibleJqueryFrameworkto *renderedcardlayoutheader. */ canvas.applnlayout.utkarsh.landingpage = Class({ /** *@class"canvas.applnlayout.utkarsh.landingpage" *@descriptionTheconstructorgetsthemetadataandparentelement(#HEADER). */ parentElem: null, constructor: function(config) { this.parentElem = config.parentElem; this.itemList = wsArr = canvas.workspace.metadata.getWorkspaces(); /** *Thisloopistosupportmultilingual.ItgetsthevalueoftheString *correspondingtothevalueofWORKSPACE_DISPLAY_NMinthepropertyfile *givenintheBUNDLE_KEY. */ for (var index = 0; index <this.itemList.length; index++) { this.itemList[index].ITEM_LABEL = !canvas.isEmpty(CRB.getBundleValue(this.itemList[index].BUNDLE_KEY, this.itemList[index].WORKSPACE_DISPLAY_NM)) ? CRB.getBundleValue(this.itemList[index].BUNDLE_KEY, this.itemList[index].WORKSPACE_DISPLAY_NM) : this.itemList[index].WORKSPACE_DISPLAY_NM; } }, /** *@methodgetHeaderDOM *@memberof"canvas.applnlayout.utkarsh.landingpage" *@descriptionThismethodisresponsibleforloadingtheuserpicture,user *info,lastlogintimewiththetemplate(cardheader.cttpl). */ getLandingDOM: function() { var componentJSON = {}; var tmpLayer = canvas.templateManager.createTemplate( 'al-landing-page.cttpl', this.itemList,canvas.util.getTemplatePath()); tmpLayer.getTemplate(this.applyTemplate, this); }, /** *@methodapplyTemplate *@memberof"canvas.applnlayout.utkarsh.landingpage" *@descriptionThismethodgetsthetemplate,appendsittotheparent *elementandaddsclicklistenerforuserpreferencesand *logout. */ applyTemplate: function(template, tmpClass) { if (!canvas.core.isEmpty(this.parentElem)) { $(this.parentElem).append(template); } $(this.parentElem).find('.workspaceIconBlock').on('click', function(e) { var workspaceID = $(this).attr('data-itemid'); canvas.workspace.metadata.getWorkspaceManager().getContainer().switchWorkspace(workspaceID); }); doIScroll('CONTENT_DIV', 'refresh'); } }); CLCR.registerCmp({ "COMPONENT": "utkarsh-sample-landing-page", "APPLICATION_FW": "JQM" }, canvas.applnlayout.utkarsh.landingpage); |
...