Template Var Changes
Posted: Wed Dec 08, 2010 12:54 am
One thing that is inconsistent, and I'm damned if I know why it's been done, is the use of a new enclosing tag in add-ons and some other areas for templates.
It's hard to gauge exactly where the changes apply and where they don't but in the add-ons here's an example of a changed file:
5.5.x version
6.x version
So to summarise:
%%LNG_Foo%% becomes {% lang 'Foo' %}
%%GLOBAL_Bar%% becomes {{ Bar|safe }}
... and before you ask, no I haven't a clue what the "safe" bit is all about... suggestions welcome there
It's hard to gauge exactly where the changes apply and where they don't but in the add-ons here's an example of a changed file:
5.5.x version
Code: Select all
<style type="text/css">
TABLE.Inventory TD { padding-right: 10px }
TR.Product TD { border-top: 2px solid gray; padding-top: 5px; padding-bottom: 5px;}
</style>
<table class="OuterPanel">
<tr>
<td class="Heading1">%%LNG_InventoryAddonName%%</td>
</tr>
<tr>
<td class="Intro">
<table class="Inventory">
<tr>
<td colspan="2"><strong>%%LNG_ProductName%%</strong></td>
<td><strong>%%LNG_StockLevel%%</strong></td>
<td><strong>%%LNG_PendingShip%%</strong></td>
<td><strong>%%LNG_AverageSold%%</strong></td>
<td><strong>%%LNG_DepletedOn%%</strong></td>
<td><strong>%%LNG_OrderPoint%%</strong></td>
<td><strong>%%LNG_SuggestedQty%%</strong></td>
</tr>
%%GLOBAL_InventoryStatus%%
</table>
</td>
</tr>
</table>
6.x version
Code: Select all
<style type="text/css">
TABLE.Inventory TD { padding-right: 10px }
TR.Product TD { border-top: 2px solid gray; padding-top: 5px; padding-bottom: 5px;}
</style>
<table class="OuterPanel">
<tr>
<td class="Heading1">{% lang 'InventoryAddonName' %}</td>
</tr>
<tr>
<td class="Intro">
<table class="Inventory">
<tr>
<td colspan="2"><strong>{% lang 'ProductName' %}</strong></td>
<td><strong>{% lang 'StockLevel' %}</strong></td>
<td><strong>{% lang 'PendingShip' %}</strong></td>
<td><strong>{% lang 'AverageSold' %}</strong></td>
<td><strong>{% lang 'DepletedOn' %}</strong></td>
<td><strong>{% lang 'OrderPoint' %}</strong></td>
<td><strong>{% lang 'SuggestedQty' %}</strong></td>
</tr>
{{ InventoryStatus|safe }}
</table>
</td>
</tr>
</table>
So to summarise:
%%LNG_Foo%% becomes {% lang 'Foo' %}
%%GLOBAL_Bar%% becomes {{ Bar|safe }}
... and before you ask, no I haven't a clue what the "safe" bit is all about... suggestions welcome there
