Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.5.0-beta1
-
None
Description
Templates that are defined inline are accessible from the os.getTemplate method call. Templates that are defined in a Template Library or in the Module header are not accessible. Inline templates process through and eventually get sent to os.registerTemplate, non-inline templates make it to os.Loader.processTemplateNode where they don't go any further (if the template has a tag, which follows the opensocial doc examples). If the template doesn't have a tag and only a name, it looks like it might work. I didn't see a name attribute included in the Open Social template spec anywhere though. Is that valid instead of "tag"?
Non-inline templates seem to work declaratively but not through the API.
Example TemplateLibrary file
<?xml version="1.0" encoding="UTF-8"?>
<Templates xmlns:acct="http://www.foo.com/templates/accounts">
<Namespace prefix="acct" url="http://www.foo.com/templates/accounts"/>
<Template tag="acct:AccountList">
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="tblAccounts">
<thead>
<tr>
<th width="10">ID</th>
<th width="200">Name</th>
<th class="edit"></th>
</tr>
</thead>
<tbody>
<tr repeat="${Top.Account}">
<td>${Cur.Key}</td>
<td>${Cur.Name}</td>
<td>
<input type="hidden" value="${Cur.id}"/>
<button onclick="editAccount('${Cur.id}');" class="btn editAccount">edit</button>
</td>
</tr>
</tbody>
</table>
</Template>
</Templates>
Attachments
Attachments
Issue Links
- is related to
-
SHINDIG-1795 Support Templates defined in module definition
-
- Open
-