NOTE: If you want fully custom messages you need to override the app Metering/macros/module.messages.utl file.
If you just want to override a single message you just have to override that macro. (See below for the individual macros)
A message with the 'data-count' attribute and a value containing a number will only be displayed at a particular count. A message without a 'data-count' attribute will, if it exists, display if there is no message for a specific count.
A message with the 'data-registered' attribute set to true/false will only be displayed when a user is logged in/not logged in these messages are only available when also using a specific count.
Elements with the 'count' class will have their content replaced with the current ascending count. Elements with the 'remaining' class will have their content replaced with the current descending count. Elements with the 'total' class will have their content replaced with the total count.
BEST PRACTICE: The utl file can be named anything, although naming it the same as the existing file may be a good idea.
Accessing Templates
The existing metering messages are located in Flex / Components / app Metering/macros/module.messages.utl
You can view these files by clicking the name of the file and View, or by double-clicking the name of the file.
To edit/replace the current metering messages go to Flex / Components / _Site / macros.
If the file module.messages.utl already exists then open it by clicking the name of the file and View, or by double-clicking the name of the file.
If the module.messages.utl doesn't exist in the macros folder, right-click on the macros folder and choose New file.
The new file must be named module.messages.utl
Example
Here is an example and an explanation of the UTL code that you will edit.
1 UTL Macro Code: This is an example of a macro that you can customize (the Title (header) and Message). A list of the macros available to you are below. The Macro Name is in the first line of the code, this does not get changed.
1a Header: Only edit what's between the open and close header tags (ie: <h4> and </h4>) - This will appear on the site as the Title.
1b Custom Comment: Only edit what's between the open and close paragraph tags (ie: <p> and </p>). Here you would enter a comment or instructions you want the user to read or do.
You can copy the macro code that you want to edit below and paste it into your module.messages.utl. If you do need to edit the macro you do not need to copy it into your module.messages.utl. If BLOX does not encounter the macro in your module.messages.utl file it will go to the TownNews version for that macro.
Customizable Macros
meter_messageLoginPrompt:
This is displayed on the asset page just before the user is prompted to login.
[% macro meter_messageLoginPrompt(); -%]
<div class="meter notification access alert alert-dismissable alert-info">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4 class="clearfix meter-heading media-heading row">
Custom Message: Login Prompt
</h4>
<p>This is a custom message</p>
</div>
[% end -%]
This is displayed on the asset page on the users first view.
[% macro meter_messageFirst(); -%]
<div class="meter notification access alert alert-dismissable alert-info hidden-print">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
[% if URL_CONFIG.metering_count != 'off' %]
<h4 class="clearfix meter-heading media-heading row">
[% if URL_CONFIG.metering_count == "asc" -%]
Viewed <span class="count"></span> of remaining of </span>
[% end %]
</div>
[% end %]
<p><strong>Welcome! We hope that you enjoy our free content.</p>
</div>
[% end -%]</pre>
If enabled, this displays on the asset page when the user has just logged in after the registration wall.
[% macro meter_messageLoggedIn(); -%]
<div class="meter notification access alert alert-dismissable alert-info">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4 class="clearfix meter-heading media-heading row">
Custom Message: Logged in
</h4>
<p>This is a custom message</p>
</div>
[% end; %]
This is displayed on the asset page just before the user is presented with the wall.
[% macro meter_messageLastFree(); -%]
<div class="meter notification access alert alert-dismissable alert-info">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4 class="clearfix meter-heading media-heading row">
Custom Message: Last Free
</h4>
<p>This is a custom message</p>
</div>
[% end; %]
If enabled, this displays on the asset page when there is no other available message.
[% macro meter_messageGeneral(); -%]
<div class="meter notification access alert alert-dismissable alert-info">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4 class="clearfix meter-heading media-heading row">
Custom Message: General
</h4>
<p>This is a custom message</p>
</div>
[% end; %]
meter_messageReadPreviously:
If enabled, this displays on the asset page when the user has already read an asset.
[% macro meter_messageReadPreviously(); -%]
<div class="meter notification access alert alert-dismissable alert-info">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4 class="clearfix meter-heading media-heading row">
Custom Message: Read Previously
</h4>
<p>This is a custom message</p>
</div>
[% end; %]
meter_messageAssetSubscription:
If enabled, this displays on the asset page when the user is required to subscribe.
[% macro meter_messageAssetSubscription(); -%]
<div class="meter message wall panel panel-default">
<div class="panel-body">
<h4 class="meter-heading media-heading">
Custom Message: Asset Subscription Wall
</h4>
<p>This is a custom message</p>
</div>
</div>
[% end; %]
meter_messageAssetRegistration:
If enabled, this displays on the asset page when the user is required to register or log in.
[% macro meter_messageAssetRegistration(); -%]
<div class="meter message wall panel panel-default">
<div class="panel-body">
<h4 class="meter-heading media-heading">
Custom Message: Asset Registration Wall
</h4>
<p>This is a custom message</p>
</div>
</div>
[% end; %]