Portal Page Developers FAQs
This article provides information on some of the most frequently asked questions regarding advanced Portal Page functionality.
- See the examples of Code Snippets for Portal Pages
Do Portal Pages inherit CSS from the rest of the application?
If setting Display without Metric Insights navigation bar on the Info tab is disabled, a Portal Page inherits all styles from the application, including its theme (if applicable).
To use custom CSS classes, we recommend adding a prefix
cp_ (custom page) in front of new class names. iframes can be used to prevent CSS overlaps from happening.
- jQuery must be used in no-conflict mode
- Highcharts v5.0.4 and Underscore.js version 1.8.3 are available globally
- Ext.js is not allowed
Data specific to a Portal Page can be stored in an “Internal” Portal Page Entity.
- Public internal entities write data available to many users
- Private internal entities write data for a specific user
- Managed (Beta) entities provide object storage that can be granted to specific users. For example,
- Dashboard 1 is granted to User A, User B, User C.
- Dashboard 2 is granted to User X, User Y, User Z.
- Inherited provides the ability to inherit access from a Dataset, Element, or Folder
How should I manage my assets?
- Sync with a Git repository located in:
- Manually upload via ZIP archive
- Directly upload via the Assets tab (Content > Portal Pages > Assets Tab) and directly link from either the Portal Page, Template, or Layout.
NOTE: You cannot reference externally hosted libraries. They must be hosted within the MI system itself. We enforce this to meet common security requirements in the enterprise.
If I use a custom theme, how do I apply those colors/styling to my Portal Page?
- If Display without Metric Insights navigation bar is disabled, the theme will be applied automatically.
- If Display without Metric Insights navigation bar is enabled + Layout is not set to "Default", the developer should explicitly include the theme CSS in their layout.
How do I track links opened from a Portal Page?
In order to call the tracking function, your Portal Page must have access to the
- If Display without Metric Insights navigation bar is disabled, this file is already included into the Portal Page by default.
- If Display without Metric Insights navigation bar is enabled + Layout is not set to "Default", include the
/js/application/portal_page_view.jsfile into Portal Page's HTML via the
href: URL of the opened link
page_internal_name: an Internal Name of the Portal Page from which the link is opened
All the tracked data is stored in the
portal_page_link table of the
Dashboard database in the following format:
How do I use the "Enable POST request navigation from other sites" option?
POST requests from sites other than current Metric Insights instance are disabled by default due to security considerations; however, this behavior can be changed by activating the Enable POST request navigation from other sites option from the Portal Page's Advanced tab. This will allow receiving POST requests from sites other than your Metric Insights instance.
An example of using this feature is configuring OAuth 2.0 authentication:
- MI sends an authentication request to the Microsoft identity platform
- User receives a POST response with an ID token and an Access token
How do I configure the condition for taking a Portal Page screenshot?
You can customize the condition for taking a screenshot while creating/configuring Portal Page Templates and Portal Pages. For more information, refer to Customize the Image Capture Setting section.
What are the common endpoints for Portal Page development?
Providing a robust set of endpoints that cover most major objects in the system, the API follows a standard RESTful design pattern and many endpoints offer the ability to PUT, POST, DELETE, etc.
Common endpoints for Portal Page development:
- element_info returns details about a specific element
- element / dashboard_data
- dataset_data returns data
- favorite can be used to add an Element to a user’s Favorites
- metric_data returns current metric value
- announcement returns properties of an announcement as well as the announcement text
- search returns paginated results from the system’s search service, the Data Analyzer
- custom_field returns the name of the custom field, its values, and other properties
- folder and folder_element return properties of a Folder and the elements that belong to a folder
In total, over 100 endpoints are available, many with multiple methods. Explore endpoints via the API Toolkit at <hostname>/api (NOTE: if you are a Power User, you will need an Admin to provide the “API Toolkit” Privilege)