Michele
07-15-2006, 07:32 PM
I didn't like the way empty categories looked and figured there had to be someplace where I could put some generic text instead - even if it was the same across every category.
I figured this out by a little trial and error and thought I would share.
Edit your templates/<template you are using>/index.tpl file.
Find the code similar to: (I'm using Kinky template)
{if $links}
<div class="box">
<div class="box-caption">{$lang.links}</div>
<div class="box-content">
<div class="links">
{navigation aTotal=$total_links aTemplate=$url aItemsPerPage=$config.num_index_links aLinksPerPage=$config.num_navig_pages aType=2}
<table cellspacing="0" cellpadding="0">
{foreach from=$links item=link}
{include file="link-display.tpl"}
{/foreach}
</table>
</div>
<!-- START VISITOR SORTING CODE -->
{if $config.visitor_sorting}
<div class="link-sorting">{$lang.sort_links_by}
{foreach from=$sortings item=order}
{if $order eq $config.links_sorting}
{$lang.$order}
{else}
<a href="{$smarty.server.REQUEST_URI|add_url_param:'order': $order}">{$lang.$order}</a>
{/if}
{/foreach}
{if $config.links_sorting_type eq 'ascending'}
{$lang.ascending} |
<a href="{$smarty.server.REQUEST_URI|add_url_param:'order_t ype':descending}">{$lang.descending}</a>
{else}
<a href="{$smarty.server.REQUEST_URI|add_url_param:'order_t ype':ascending}">{$lang.ascending}</a> |
{$lang.descending}
{/if}
</div>
{/if}
<!-- END VISITOR SORTING CODE -->
</div>
</div>
{/if}
Before the {/if} and after the second </div> put the following:
{else}
<div class="box">
<p>You could be the first to list in this category!</p>
</div>
I did create a class and use an H1 tag instead of a paragraph tag.
If anyone knows how to make this say the category name that would be even better! My attempts only got the last top category in my database. :rolleyes:
A little cosmetic suggestion too...When a category is empty but has subcategories, the text looked kinda stupid just hanging under the subcategory list so I also made the following change:
In the same file just above the long section quoted above add an <hr> tag as shown:
{if $categories}
<h1>Subcategories</h1>
<div class="box">
{$categories}
</div>
<hr />
{/if}
I figured this out by a little trial and error and thought I would share.
Edit your templates/<template you are using>/index.tpl file.
Find the code similar to: (I'm using Kinky template)
{if $links}
<div class="box">
<div class="box-caption">{$lang.links}</div>
<div class="box-content">
<div class="links">
{navigation aTotal=$total_links aTemplate=$url aItemsPerPage=$config.num_index_links aLinksPerPage=$config.num_navig_pages aType=2}
<table cellspacing="0" cellpadding="0">
{foreach from=$links item=link}
{include file="link-display.tpl"}
{/foreach}
</table>
</div>
<!-- START VISITOR SORTING CODE -->
{if $config.visitor_sorting}
<div class="link-sorting">{$lang.sort_links_by}
{foreach from=$sortings item=order}
{if $order eq $config.links_sorting}
{$lang.$order}
{else}
<a href="{$smarty.server.REQUEST_URI|add_url_param:'order': $order}">{$lang.$order}</a>
{/if}
{/foreach}
{if $config.links_sorting_type eq 'ascending'}
{$lang.ascending} |
<a href="{$smarty.server.REQUEST_URI|add_url_param:'order_t ype':descending}">{$lang.descending}</a>
{else}
<a href="{$smarty.server.REQUEST_URI|add_url_param:'order_t ype':ascending}">{$lang.ascending}</a> |
{$lang.descending}
{/if}
</div>
{/if}
<!-- END VISITOR SORTING CODE -->
</div>
</div>
{/if}
Before the {/if} and after the second </div> put the following:
{else}
<div class="box">
<p>You could be the first to list in this category!</p>
</div>
I did create a class and use an H1 tag instead of a paragraph tag.
If anyone knows how to make this say the category name that would be even better! My attempts only got the last top category in my database. :rolleyes:
A little cosmetic suggestion too...When a category is empty but has subcategories, the text looked kinda stupid just hanging under the subcategory list so I also made the following change:
In the same file just above the long section quoted above add an <hr> tag as shown:
{if $categories}
<h1>Subcategories</h1>
<div class="box">
{$categories}
</div>
<hr />
{/if}