AndrewSimm
Well-known member
Throughtout XF I see the links are built usign {{ link('page', $var) }}. I am trying to understand how the variable is used within the link. if you look at my code below, I can get it to work when I do <a href="/articles/categories/{$category.category_id}/delete" but I know that should be {{ link('articles/categories', $categories) }}. The problem is that is not working for me and I do not know why.
HTML:
<xf:foreach loop="$categories" value="$category">
<tr class="dataList-row">
<td class="dataList-cell dataList-cell--link">
<a href="{{ link('articles/categories/', $category) }}" />{$category.category}</a>
</td>
<xf:if is="{{ $xf.visitor.hasPermission('andrew_articles', 'canEditCategory') }}">
<td class="dataList-cell dataList-cell--action">
<a href="{{ link('articles/categories/edit', $category) }}" class="dataList" data-xf-click="overlay" data-original-title="Edit">Edit</a>
</td>
</xf:if>
<xf:if is="{{ $xf.visitor.hasPermission('andrew_articles', 'canDeleteCategory') }}">
<td class="dataList-cell dataList-cell--action">
<a href="/articles/categories/{$category.category_id}/delete" class="dataList" data-xf-click="overlay" data-original-title="Delete">Delete</a>
</td>
</xf:if>
</tr>
</xf:foreach>