Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I set a CSS class on a table row based on a property of an ATK node attribute in ATK-Framework?
    text
    copied!<p>I have an <a href="http://www.atk-framework.com/" rel="nofollow">ATK-Framework</a> which I'm inheriting from a previous (departed) developer, and I'm finding the documentation to be sparse and poorly structured.</p> <p>We have a subscription system where customer register an account, and then there can be multiple subscriptions on that account. The classes for accounts and subscriptions inherit from atkNode.</p> <p>I want to be able to highlight a row in a table of subscriptions so that it is easier to see, at a glance, when a particular subscription has expired. The expiry date of the subscription is already a property of that node.</p> <p>I can easily find the code where the node is created in the framework's modules - but try as hard as I can, I can't find any corresponding HTML template to display this information, and so can't find anyway to add in the required logic to highlight these rows.</p> <p>-- Update:</p> <p>After some more clicking around, I've found the templates - they're in the main ATK framework directory (including the custom templates that my predecessor has created).</p> <p>They appear to be smarty-like templates, so modifying/extending them shouldn't be too hard.</p> <p>--</p> <p>So, I found the following in the template:</p> <pre><code>{foreach from=$rows item=row} &lt;tr id="{$row.id}" class="row{if $row.rownum % 2 == 0 }1{else}2{/if}" {if $row.background!=""}style="background-color:{$row.background}" {/if} onmouseover="highlightrow(this, '{$row.highlight}')" onmouseout="resetrow(this)" onclick="selectrow(this, '{$listid}', {$row.rownum})"&gt; {section name=colloop loop=$row.cols} &lt;{if $row.type == "subtotal"}th{else}td{/if} class="{if $smarty.section.colloop.index===0}recordListTdFirst{else}recordListTd{/if}{if $row.cols[colloop].type == "data"} clickable{/if}" valign="{$vorientation}" {if isset($row.cols[colloop].htmlattributes)}{$row.cols[colloop].htmlattributes}{/if} {if $row.cols[colloop].type == "data"} onclick="rl_try('{$listid}', event, {$row.rownum}, ['select', 'edit', 'view'], false);"{/if}&gt; {if $row.cols[colloop].content != ""}{$row.cols[colloop].content}{else}&amp;nbsp;{/if} &lt;/{if $row.type == "subtotal"}th{else}td{/if}&gt; {/section} &lt;/tr&gt; {/foreach} </code></pre> <p>I'm guessing that $row and $cols are set by the class...</p> <p>There's a couple of problems - this recordlist.tpl is a generic template. This means that I can't just jam a check for the expiry date at this point.</p> <p><strong>Is there a way to override this template for one specific node/recordset?</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload