Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Is it possible to change only the category's tag colour?

edited December 2011 in Vanilla 2.0 - 2.8

Is it possible to change only the category's tag collor?

Best Answer

  • Options
    KastangKastang New
    Answer ✓

    Its fairly simply to do:

    Move applications/vanilla/views/discussions/helper_functions.php
    to themes/[YOURTHEME]/views/discussions/helper_functions.php

    Find:

     if (C('Vanilla.Categories.Use') && $Discussion->CategoryUrlCode != '')
          echo Wrap(Anchor($Discussion->Category, '/categories/'.rawurlencode($Discussion->CategoryUrlCode), 'Category'));
    

    Change To:

    if (C('Vanilla.Categories.Use') && $Discussion->CategoryUrlCode != '')
         echo Wrap(Anchor($Discussion->Category, '/categories/'.rawurlencode($Discussion->CategoryUrlCode), 'Category_'.$Discussion->CategoryID));
    

    This will add a unique tag to each category class in the form of Category_{CATEGORYID}. You can wrap the classes in whatever colors you want using CSS then.

Answers

  • Options

    change them in the css?

  • Options

    I want to do it individually, so e.g. category 1 = yellow, category 2 = blue ...

  • Options
    KastangKastang New
    Answer ✓

    Its fairly simply to do:

    Move applications/vanilla/views/discussions/helper_functions.php
    to themes/[YOURTHEME]/views/discussions/helper_functions.php

    Find:

     if (C('Vanilla.Categories.Use') && $Discussion->CategoryUrlCode != '')
          echo Wrap(Anchor($Discussion->Category, '/categories/'.rawurlencode($Discussion->CategoryUrlCode), 'Category'));
    

    Change To:

    if (C('Vanilla.Categories.Use') && $Discussion->CategoryUrlCode != '')
         echo Wrap(Anchor($Discussion->Category, '/categories/'.rawurlencode($Discussion->CategoryUrlCode), 'Category_'.$Discussion->CategoryID));
    

    This will add a unique tag to each category class in the form of Category_{CATEGORYID}. You can wrap the classes in whatever colors you want using CSS then.

  • Options

    Hello, is a good plugin but you should use compatible php5 code , not is recommended to use <? short tags in this times, not its supported for most servers.

    regards,

Sign In or Register to comment.