We’ve migrated our documentation to a new site, which means some URLs have changed.
Subscriptions

How to remove the "Select a contract" screen for Site Licenses?

By default, if a user visits a page targetted by a Piano Site License template, they will see a modal with a "Select a contract" screen where they can select the respective contract from a drop-down menu. If your setup is targetting users only with one contract per license, you can skip this screen so the user will be shown directly the Site License contract redemption screen.

To do so, in the Piano dashboard under ManageTemplates, you would find the Site Licensing Contract List template and select to edit its (HTML) code.

Starting on line 25 is the code that you will need to add:

image

And replace the ID "TMYSKZ29PA0S" with the actual contract ID from your Piano dashboard.

To add additional contracts, you would edit the template as follows.

After line 29 you would add the following, and replace the "ID" with the actual contract ID value:

    {
      contractId: 'ID',
    },

So the full code would now look like this:

HTML
<div
  ng-init="contracts = [
    {
      contractId: 'TMYSKZ29PA0S',
    },
    {
      contractId: 'ID',
    },    
  ]"
>
  <div ng-repeat="contract in contracts">
    <div id="contract-debugger" style="display: none;">{{contracts}}</div>
    <div ng-if="params.url.includes(contract.contractId)">
      <div ng-init="showContractInfo(contract.contractId)"></div>
    </div>
  </div>
</div>

And if you'd like to add another contract ID, you would proceed in the same way (now replacing the "ID2" with the third contract ID and so on:

HTML
<div
  ng-init="contracts = [
    {
      contractId: 'TMYSKZ29PA0S',
    },
    {
      contractId: 'ID',
    },    
    {
      contractId: 'ID2',
    },     
  ]"
>
  <div ng-repeat="contract in contracts">
    <div id="contract-debugger" style="display: none;">{{contracts}}</div>
    <div ng-if="params.url.includes(contract.contractId)">
      <div ng-init="showContractInfo(contract.contractId)"></div>
    </div>
  </div>
</div>

Last updated: