Skip to content

Title Mapping Configuration

Overview

The title-mapping.json file manages device-specific titles for selected FAQ pages in app-embedded mode. When the app opens an FAQ page with URL parameters, the site replaces the page title for the specified device and hides the navigation bar and sidebar.

Currently Supported FAQ Pages

  1. Device offline - /faq/offline/device/
  2. Inaccurate sensor data - /faq/measure/inaccurate-monitoring-data/

File Structure

{
    "device_titles": {},
    "page_titles": {
        "offline_device": {
            "h5lite": "My H5Lite is Offline. What should I Do?",
            "h5pro": "My H5Pro is Offline. What should I Do?",
            "ns1": "My NS1 is Offline. What should I Do?"
        },
        "measure_inaccurate": {
            "st5": "My ST5 Sensor is inaccurate. What should I do?",
            "ms1": "My MS1 Sensor is inaccurate. What should I do?",
            "st6": "My ST6 Sensor is inaccurate. What should I do?",
            "st8": "My ST8 Sensor is inaccurate. What should I do?",
            "st9": "My ST9 Sensor is inaccurate. What should I do?",
            "ls3": "My LS3 Sensor is inaccurate. What should I do?"
        }
    }
}

Add a Device Model

Add a Device to an Existing FAQ Page

Add the device model under the applicable page type:

"page_titles": {
    "offline_device": {
        "h5lite": "My H5Lite is Offline. What should I Do?",
        "h5pro": "My H5Pro is Offline. What should I Do?",
        "ns1": "My NS1 is Offline. What should I Do?",
        "new_device": "My New Device is Offline. What should I Do?"  // New
    },
    "measure_inaccurate": {
        "st5": "My ST5 Sensor is inaccurate. What should I do?",
        "ms1": "My MS1 Sensor is inaccurate. What should I do?",
        "new_sensor": "My New Sensor is inaccurate. What should I do?"  // New
    }
}

Add an FAQ Page

1. Add a Page Type to page_titles

"page_titles": {
    "offline_device": { /* ... */ },
    "measure_inaccurate": { /* ... */ },
    "new_faq_page": {
        "h5pro": "My H5Pro New Issue Title",
        "h5lite": "My H5Lite New Issue Title",
        // ... Other devices
    }
}

2. Update the JavaScript

Add the page path check to the getTitleForPage function in extra.js:

// Determine the page type from the page path.
if (pagePath.includes('/faq/offline/device/')) {
    pageType = 'offline_device';
} else if (pagePath.includes('/faq/measure/inaccurate-monitoring-data/')) {
    pageType = 'measure_inaccurate';
} else if (pagePath.includes('/faq/new-page/')) {  // New
    pageType = 'new_faq_page';
}

Usage Examples

App-Embedded URL Format

Device offline page:

https://doc.mocreo.com/faq/offline/device/?app=true&hub=h5pro
https://doc.mocreo.com/faq/offline/device/?app=true&hub=h5lite
https://doc.mocreo.com/faq/offline/device/?app=true&hub=ns1

Inaccurate sensor data page:

https://doc.mocreo.com/faq/measure/inaccurate-monitoring-data/?app=true&hub=st5
https://doc.mocreo.com/faq/measure/inaccurate-monitoring-data/?app=true&hub=ms1
https://doc.mocreo.com/faq/measure/inaccurate-monitoring-data/?app=true&hub=st6

Supported Parameters

  • app=true - Enables app-embedded mode and hides the top navigation, sidebar, and footer.
  • hub=<device_type> - Specifies the device model.

Standard Access Without Parameters

Open the original URLs to display the complete interface and default title:

https://doc.mocreo.com/faq/offline/device/
https://doc.mocreo.com/faq/measure/inaccurate-monitoring-data/

Maintenance Recommendations

  1. Device model names: Use lowercase letters that match the product model.
  2. Title format: Keep titles consistent.
  3. Device offline: "My [Device] is Offline. What should I Do?"
  4. Inaccurate sensor data: "My [Device] Sensor is inaccurate. What should I do?"
  5. Testing: After adding a device, test the title with the applicable URL parameters.
  6. Backup: Back up the configuration before making changes.

Troubleshooting

If the title is not displayed correctly:

  1. Confirm that the device model exists under the applicable page type.
  2. Confirm that the page path matches exactly, including the trailing slash.
  3. Check the browser console for JavaScript errors.
  4. Confirm that the configuration file contains valid JSON.
  5. Confirm the URL parameter format: ?app=true&hub=<device_type>.

Current Limitations

  • Only the two listed FAQ pages are supported.
  • New FAQ page paths must be added manually to the JavaScript.
  • Device models must be predefined in the configuration file.