Web Part Configuration Properties

2024-03-28

Web parts can be customized using a variety of properties, detailed in this topic. These properties can be used when displaying a web part in a wiki using the embedding syntax. Not all of these properties and options are available via the user interface, and those that are sometimes have different naming there, or are only available in page admin mode.

Properties Common to All Web Parts

Two properties exist for all web parts. These properties can be set in addition to the web-part-specific properties listed below.

  • showFrame: Whether or not the title bar for the web part is displayed. For example, for wiki pages, the title bar includes links such as "Edit" and "Manage". You will want to set showFrame='false' to show web part content seamlessly within a wiki page, for example. Values:
    • true (the default)
    • false
  • location: Indicates whether the narrow or wide version of the web part should be used, if both options are available. Including a second location setting of 'menu' will make the web part available for use as a custom menu.
    • content (the default)
    • right (aka 'narrow')
    • menu
Not all web parts provide different formatting when the location parameter is set to 'right'. For example, the Wiki web part does not change its display, it merely tightens the word wrap. Others (such as Protein Search, Sample Types, Files) change their layout, the amount of data they display, and in some cases the functions available.

Properties Specific to Particular Web Parts

Properties specific to particular web parts are listed in this section, followed by acceptable values for each. Unless otherwise indicated, listed properties are optional.

Assay Runs

  • viewProtocolId: The rowID (sometimes referred to as the protocolID) for the assay design. You can find it in the URL for most assay pages.

Files

The Files web part supports uploading and browsing of files in the container.

  • fileSet: When one or more named file sets are defined, use this parameter to select which to display. Learn more here: Named File Sets.
  • folderTreeVisible: Whether to show the folder tree panel on the left.
  • fileRoot: Set to use a subfolder as the root for this Files web part. Include the "@files" root in the value. For example: fileRoot : '@files/subfolder/'

Issues List/Summary

The Issues List and Issues Summary web parts list issues in the current folder's issue tracker.

  • title: Title of the web part. Useful only if showFrame is true. Default: "Issues List" or "Issues Summary" respectively.

List - Single

  • listName: The name of the list.

Query

The Query web part shows the results of a query as a grid.

  • allowChooseQuery: Boolean. If the button bar is showing, whether to let the user choose a different query.
  • allowChooseView: Boolean. If the button bar is showing, whether to let the user choose a different view.
  • buttonBarPosition: String. Determines whether the button bar is displayed.
    • none
    • top
  • queryName: String. The query to show. If omitted, then the list of queries in the schema is shown.
  • schemaName: (Required) String. Name of schema that this query is defined in.
  • shadeAlternatingRows: Boolean. Whether the rows should be shaded alternating grey/white.
  • showDetailsColumn: Boolean. Whether to show the detail links for each row.
  • showFrame: Boolean. If false, the title is not shown.
  • showUpdateColumn: Boolean. Whether to show the selecter column for each row.
  • title: Title to use on the web part. If omitted, the query name is displayed.
  • viewName: Custom view to show from that query or table.
Example:

<p>${labkey.webPart(partName='Query', 
allowChooseQuery ='false',
allowChooseView = 'false',
buttonBarPosition ='none',
queryName ='Tutorials',
schemaName ='lists',
shadeAlternatingRows='false',
showDetailsColumn='false',
showFrame='false',
showUpdateColumn='false',
title = 'New User Tutorials',
viewName='newuser')
}</p>

Report

  • reportId: The ID of the report you wish to display, shown in the URL. If the URL includes 'db:151', the reportID would be 151.
  • schemaName, queryName and reportName: You can use these three properties together as an alternative to reportId. This is a handy alternative in scripts designed to run on both test and production systems when the reportID would be different.
  • showSection: Optional. The section name of the R report you wish to display. Optional. Section names are the names given to the replacement parameters in the source script. For example, in the replacement '${imgout:image1}' the section name is 'image1'. If a section name is specified, then only the specified section will be displayed. If not, by default, all sections will be rendered.
<p>${labkey.webPart(partName='Report', 
reportName='My Samples Report',
queryName ='MySamples',
schemaName ='samples',
showFrame='false',
title = 'Report Title'
)}</p>

Search

The Search web part is a text box for searching for text strings.

  • includeSubFolders: Whether to include subfolders in the search
    • true (the default)
    • false

Wiki

  • name: Required. Title name of the page to include.
  • webPartContainer: The ID of the container where the wiki pages live. Default: the current container. Obtain a container's ID either by going to (Admin) > Folder > Management and clicking the Information tab, or by replacing the part of the URL after the last slash with "admin-folderInformation.view?". For example, to find the container ID of the home project on a local dev machine, use:
    http://localhost:8080/labkey/home/admin-folderInformation.view?

Wiki Table of Contents

  • title: Title for the web part. Only relevant if showFrame is TRUE. Default: "Pages".
  • webPartContainer: The ID of the container where the wiki pages live. Default: the current container. Obtain a container's ID as described above.

Projects

The Projects web part displays the projects or folders in a variety of ways that can be customized. When you use the user interface, the names of selectable options differ somewhat from the parameters used internally, listed here.

  • containerTypes: Which content to display in this web part:
    • project (the default)
    • folder
  • iconSize: What size icons to show
    • large (the default)
    • medium
    • small
  • labelPosition: Where to display the text label. You will want to use 'side' if the iconSize is small.
    • bottom (the default)
    • side
  • containerFilter: Which containers to show for the containerType set. Typical combinations are Project/CurrentAndSiblings and Folder/CurrentAndFirstChildren.
    • CurrentAndSiblings
    • CurrentAndFirstChildren
  • includeWorkbooks: Whether to include workbooks as "subfolders"
    • true
    • false
  • hideCreateButton: Whether to hide the "Create New Project" button.
    • false (the default - i.e. by default the button is shown)
    • true

Subfolders

The subfolders web part can be added to a page separately through the user interface. It has the same configuration properties as a Projects web part, with the following settings preapplied:

  • containerTypes=Folder
  • containerFilter=CurrentAndFirstChildren

Related Topics