How do I make icons for Catagories?
So I have vanilla installed on http://ieatthings.com and it's working great so far.
however, i was wondering if it was at all possible to change the 'categories' field from text, to small rectangular icons, similar to something like this http://forums.somethingawful.com/.
notice those icons on the left next to the subforums? I'd like icons to appear instead of say "general [public]" or "scwvd [public]" both on the right of my threads and on the right hand side of the forum under "categories".
is this possible? if so, let me know!
however, i was wondering if it was at all possible to change the 'categories' field from text, to small rectangular icons, similar to something like this http://forums.somethingawful.com/.
notice those icons on the left next to the subforums? I'd like icons to appear instead of say "general [public]" or "scwvd [public]" both on the right of my threads and on the right hand side of the forum under "categories".
is this possible? if so, let me know!
Tagged:
0
Comments
Copy
/applications/vanilla/views/modules/categories.phpto/themes/your_theme_name/views/modules/categories.phpThen edit the contents however you like. One nice way would be to do it with CSS. You can give the containing LI a class name based on the category url stub. Here's how I'd do it (just the top 19 lines of the file quoted here):
<?php if (!defined('APPLICATION')) exit();
Then, of course, you'd need to add css to your theme so that it knows what image to load under each category.$CountDiscussions = 0;
$CategoryID = isset($this->_Sender->CategoryID) ? $this->_Sender->CategoryID : '';
if ($this->_CategoryData !== FALSE) {
foreach ($this->_CategoryData->Result() as $Category) {
$CountDiscussions = $CountDiscussions + $Category->CountDiscussions;
}
$CssClass = $Category->UrlCode;
?>
<div class="Box">
<h4><?php echo T('Categories'); ?></h4>
<ul class="PanelInfo">
<li class="<?php
echo $CssClass;
if (!is_numeric($CategoryID))
echo ' Active';
?>"><strong><?php echo Anchor(Gdn_Format::Text(T('All Discussions')), '/discussions'); ?></strong> <?php echo $CountDiscussions; ?></li>