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

Show answer label only for accepted answers

edited December 2011 in Vanilla 2.0 - 2.8

Is there a way to only show the "answered label" for posts with accepted answers? Also, how to you get a checkmark next to the accepted post? The board here has that feature.

Best Answer

  • Options
    422422 Developer MVP
    Answer ✓

    this can be done quite easily.

    The class vanilla use for Accepted is:
    class="Tag QnA-Tag-Accepted"

    The class for answered is:
    class="Tag QnA-Tag-Answered"

    So with some css jiggery pokery it could be solved quite easily. As for the tick, that is controlled by the plugin. I dont think the devs have actually released that. But uses a unicode tick next to answer, so pretty easy to hack

    There was an error rendering this rich post.

Answers

  • Options
    422422 Developer MVP
    Answer ✓

    this can be done quite easily.

    The class vanilla use for Accepted is:
    class="Tag QnA-Tag-Accepted"

    The class for answered is:
    class="Tag QnA-Tag-Answered"

    So with some css jiggery pokery it could be solved quite easily. As for the tick, that is controlled by the plugin. I dont think the devs have actually released that. But uses a unicode tick next to answer, so pretty easy to hack

    There was an error rendering this rich post.

  • Options
    ToddTodd Chief Product Officer Vanilla Staff

    The latest version of Q&A has the following translation:

    $Definition['Q&A Accepted'] = 'Answered ✓';
    
  • Options

    I'm still not sure how I would make it blank unless an answer was accepted. I tried this but it still leaves a little black square.

    $Definition['Q&A Answered'] = '';

  • Options

    OrganicBytes said:
    this but it still leaves a little black square.
    $Definition['Q&A Answered'] = '';

    You need to look in the sourcecode where $Definition['Q&A Answered'] is used.
    Then you need to do an if-then-else function in the view to hide the $Definition['Q&A Answered'] when the question is not answered.
    Everything will be much clearer once you've found the piece of code where $Definition['Q&A Answered'] is used.

    There was an error rendering this rich post.

  • Options
    ToddTodd Chief Product Officer Vanilla Staff

    Sometimes you've got to look for the easy solution:

    .QnA-Tag-Answered { display: none; }
    
Sign In or Register to comment.