Jeremy
in memoriam 1991-2020
OK, so this is the first add-on with a template for me (Cezz did most of the templates for Shorten URL). Here's my template:
However, I have a problem.
HTML:
<xen:title>~Custom BB Codes~</xen:title>
<xen:topctrl>
<a href="{xen:adminlink 'add-ons/install-confirm'}" class="button">+ ~Create New BB Code~</a>
</xen:topctrl>
<link rel="xenforo_stylesheet" type="text/css" href="filter_list.css" />
<xen:require js="js/xenforo/filter_list.js" />
<xen:form action="{xen:adminlink add-ons}" class="section">
<xen:if is="{$codes}">
<h2 class="subHeading">
<link rel="xenforo_template" type="text/html" href="filter_list_controls.html" />
~Custom BB Codes~
</h2>
<ol class="FilterList">
<xen:foreach loop="$codes" value="$addOn">
<xen:listitem id="{$.addon_id}"
label="{$codes.title}"
labelclass="{xen:if '!{codes.active}', 'disabled'}"
snippet="{$codes.tag}"
href="{xen:if $customBBCodes, {xen:adminlink 'add-ons/edit', $codes}}"
delete="{xen:adminlink 'add-ons/delete', $codes}"
deletehint="{xen:phrase uninstall}">
<xen:popup title="{xen:phrase controls}" ctrlclass="toolsCtrl">
<xen:link href="{xen:adminlink 'custom-bb-codes/delete', $codes}">{xen:phrase delete}</xen:link>
<xen:link href="{xen:adminlink 'custom-bb-codes/disable', $codes, '_xfToken={$visitor.csrf_token_page}'}" displayif="{$codes.active}">{xen:phrase disable}</xen:link>
<xen:link href="{xen:adminlink 'custom-bb-codes/enable', $codes, '_xfToken={$visitor.csrf_token_page}'}" displayif="!{$codes.active}">{xen:phrase enable}</xen:link>
<xen:link href="{xen:adminlink 'custom-bb-codes/edit', $codes}" displayif="{$customBBCodes}">{xen:phrase edit}</xen:link>
</xen:popup>
</xen:listitem>
</xen:foreach>
</ol>
<p class="sectionFooter">{xen:phrase showing_x_of_y_items, 'count=<span class="FilterListCount">{xen:count $codes}</span>', 'total={xen:count $codes}'}</p>
<xen:else />
<div class="noResults">~You have no custom BB Codes~</div>
</xen:if>
</xen:form>
However, I have a problem.
- href="{xen:if $customBBCodes, {xen:adminlink 'add-ons/edit', $codes}}" doesn't work. I'm using a custom Admin Permission for this...
- Edit link doesn't show, is it the same problem as 1?