4.21.3.5. User-defined tab

You can create a custom tab with the following steps:

  1. Copy the following section in the custom_config.json file inside of curly brackets.

      "digitalTwinTabSettings": {
        "customTabs": [
          {
            "id": "customTab",
            "name": {
              "de-DE": "Zusatzinformationen",
              "en-GB": "Additional information"
            },
            "url": "/plugins/tabContent.html?NB=$NB."
          }
        ]
      }
    

    Possible URL parameters

    You can specify various parameters that are passed to the HTML using this schema:

    <beliebiger Parametername>=$<key>.

    The following parameters are possible:

    ORDERNO, PATH, MIDENT, NN, NB, NT, LINA, LINEID, LINESUBID and VARIABLENNAME.

    Link several parameters with &.

    Example with all parameters (as in fig. above)

    "url": "/plugins/tabContent.html?Order number=$ORDERNO.&pfad=$PATH.&MIDENT=$MIDENT.
     &Standard number=$NN.&Standard name=$NB.&Standard text=$NT.&BOM name=$LINA.
     &LineId=$LINEID.&LineSubId=$LINESUBID.&Diameter=$D.",

  2. Create in the folder $CADENAS_SITESETUP/3df/plugins a new HTML file "tabContent.html" and copy the following content in. If the folder doesn't exist, create it.

    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
      </head>
    
      <body>
        <div>Custom Tab Content</div>
        <div>Url Params:</div>
    
        <script>
          window.addEventListener("load", () => {
            const queryParams = new URLSearchParams(window.location.search);
            queryParams.forEach((value, key) => {
              const div = document.createElement("div");
              div.textContent = `${key} - ${value}`;
              document.body.appendChild(div);
            });
          });
        </script>
      </body>
    </html>
  3. The tab should now be displayed in 3Dfindit.

  4. Optional:

    You can restrict the display of the tab with conditions. Use "condition" to do this.

    This only works for the two parameters erpRole and catalog. Subdirectories can also be specified for catalog.

    Example 1:

    "condition": {
              "erpRole": ["DUMMY"],
              "catalog": ["a4hydrauliek"]
            }

    Example 2:

    "condition": {
              "catalog": ["norm/iso"]
            }

    Insert the code after "url" and make sure to separate the two commands with a comma.

            ...
            "url": "/plugins/tabContent.html?NB=$NB.",
            "condition": {
              "erpRole": ["DUMMY"],
              "catalog": ["a4hydrauliek"]
            }
          }