# Program Detail Page The Program Detail Page displays detailed, program-level information for each of the programs that has submitted data to your data sharing platform. A Bento Program Detail Page has several configurable components. See below for details. ![Program Detail Page Elements](https://github.com/CBIIT/bento-docs/blob/master/assets/program-detail-page.png?raw=true) **Program Detail Page Elements.** Displayed are the configurable components of a Bento Program Detail Page: Program Detail Page Title, Program Detail Page Subtitle, Program Detail Page Icon, Breadcrumb, Data Labels, Data Fields, Table Title, Table Column Header, Table Column Content, Program Level Aggregate Count, Program Level Donut Widget, Program Level File Count Widget and Embedded External and Internal Links. ### Prerequisites 1. The files that specify the configuration parameters of the Bento Landing Page are stored in the GitHub `https://github.com/CBIIT/bento-frontend` (representing your GitHub username as `YOUR-USERNAME`). Create a local clone of your fork into a local directory, represented in these instructions as `$(src)`. 2. Configuration Parameters for all Program Detail Page elements can be specified in the file: `$(src)/bento-frontend/blob/master/src/bento/programDetailData.js`. 3. All images and icons that you use in your Bento instance should be accessible via a public url. 4. Please review the list of [GraphQL queries](https://github.com/CBIIT/bento-backend/blob/master/src/main/resources/graphql/bento-extended-doc.graphql) to select query type(s) that return your data of interest. ## Page Title Configuration The Page Title section has three components: (a) Page Title (b) Page Subtitle and (c) Breadcrumb. ### Configuring the Page Title, Page Subtitle and Breadcrumb 1. Open `$(src)/bento-frontend/src/bento/programDetailData.js`. 2. Under `pageTitle`: * Set the field `label` to the Page Title of your choice. * Set the field `datafield` to the GraphQl API query that returns the Page Title. 3. Under pageSubTitle: * Set the field `datafield` to the GraphQL API query that will return the Page Subtitle. 4. Under `breadCrumb`: * Set the field `label` to the Breadcrumb text of your choice. * Set the field `link` to the internal link to be embedded in your Breadcrumb. 5. Add your GraphQL API queries to `PROGRAM_DETAIL_QUERY`. 6. Example: ```javascript ... const pageTitle = { label: '', datafield: '', }; const pageSubTitle = { datafield: '', }; const breadCrumb = { label: '', link: '', }; ... ``` ## Configuring the Aggregate Count The Program Level Aggregate Count field allows you to display a Program level count for an key data entity in your data sharing platform. 1. Open `$(src)/bento-frontend/src/bento/programDetailData.js`. 2. Under `aggregateCount`: * Set the field `labelText` to the display text for the aggregate count of your choice. * Set the field `dataField` to the GraphQL API query that returns your aggregate count. * Set the field 'link' to the embedded link for the aggregate count. This is usually a link to an internal page that displays additional detail on the aggregate count. * Set the field `display` to 'true' if you want to display an aggregate count, 'false' otherwise. 3. Add your GraphQL API queries to `GET_PROGRAM_DETAIL_DATA_QUERY`. 4. Example: ```javascript ... const aggregateCount = { labelText: '', dataField: '', link: '', display: '', }; ... const GET_PROGRAM_DETAIL_DATA_QUERY = gql`{ ... '' ... } ``` ## Configuring icons in the Program Detail Page The Progam Detail Page supports a Program Detail Page Icon, displayed next to the Program Title, and an External Link Icon, that is displayed next to an external link in the page. 1. Open `$(src)/bento-frontend/src/bento/programDetailData.js`. 2. Under `programDetailIcon`: * Set the field 'src' to the URL for the Program Detail Page Icon of your choice. * Set the field 'alt' to the ALT tag for the Program Detail Page Icon. 3. Under `externalLinkIcon`: * Set the field 'src' to the URL for the External Link Icon of your choice. * Set the field 'alt' to the ALT tag for the External Link Icon. 4. Example: ```javascript ... const programDetailIcon = { src: '', alt: '', }; const externalLinkIcon = { src: '', alt: '', }; ... ``` ## Configuring the Program Detail Page Panels The Program Detail Page is divided into a Left Hand Panel and a Right Hand Panel. The Left Panel displays a set of Program specific details in the form of label-value pairs. The Right Panel displays Program level information as a set of graphics. ### Configuring the Left Hand Panel The left panel can display a maximum of **6** attributes as label:value pairs. If you add more than 6 attributes, **Bento will display only the first 6 attributes without a warning or error message**. 1. Open `$(src)/bento-frontend/src/bento/programDetailData.js`. 2. Under `leftPanel`: * Add an object ({dataField: ; label: })to the `attribute` list. * Set the field `dataField` to the GraphQL API query that returns the data field of your choice. This will be displayed as the value of in a label:value pair. * Set the field `label` to a display label of your choice. 3. Add your GraphQL API queries to `PROGRAM_DETAIL_QUERY`. 4. You can add an embedded link to your label or your value, or both. Links can be internal or external. * To add a link to your *value* specify an internal or external link by adding a `link` attribute to your object. * To add a link to your *label* specify an internal or external link by adding a `internalLinkToLabel` or `externalLinkToLabel` attribute, respectively, to your object. Examples of four types of embedded links are given below. See below for additional notes on adding internal and external links. 4. Example: ```javascript ... const leftPanel = { attribute: [ { //Label:Value pair with an internal link embedded in the Value. dataField: '', label: '