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.
how to remove the thread counts in category side panel?
shozen1
New
Best Answer
-
whu606 MVP
In addition to Firebug in Firefox, someone on here recommended Agent Ransack (I'm on Windows) or Grep for command line searching.
Using Firebug it shows that the relevant element is PanelCategories.
Searching for"PanelCategories" in Agent Ransack shows that it occurs in
vanilla\applications\vanilla\views\modules\categories.php
I'm assuming it would be this line
<span class="Count"><?php echo number_format($CountDiscussions); ?>
which you would need to edit.
0
Answers
thru Css?
erm thanks @Aolee, but I was hoping someone could show me what the code looks like etc
There was an error rendering this rich post.
Let me explain. I would like to replace the post count in the category view on the sidepanel with a small image to represent the category. I can only find the styling for post count in /applications/dashboard/design/style.css which just takes away highlighting but doesn't remove the post count completely.
There was an error rendering this rich post.
@shozen1
In addition to Firebug in Firefox, someone on here recommended Agent Ransack (I'm on Windows) or Grep for command line searching.
Using Firebug it shows that the relevant element is PanelCategories.
Searching for"PanelCategories" in Agent Ransack shows that it occurs in
vanilla\applications\vanilla\views\modules\categories.php
I'm assuming it would be this line
<span class="Count"><?php echo number_format($CountDiscussions); ?>
which you would need to edit.
@whu606 - thank you so much.
And to further clarify, this line is for all discussions
and this line is for custom categories below all discussions
There was an error rendering this rich post.
@whu606
I have got this to 'work' as I wanted, but I am now receiving errors in my server log related to the file: vanilla\applications\vanilla\views\modules\categories.php below is a snippet of lines 37 and 38 where the error is located somewhere and as I can't read PHP very well, its difficult to see where it is.
error log: PHP Parse error: syntax error, unexpected ';' on line 37
error log: PHP Parse error: syntax error, unexpected '}', expecting ',' or ';' on line 38
line 37
echo Wrap(Anchor(($Category->Depth > 1 ? '↳ ' : '').Gdn_Format::Text($Category->Name), '/categories/'.rawurlencode($Category->UrlCode)), 'strong')
line 38
.'<span class="Count"></span>';
There was an error rendering this rich post.
get rid of the line break between lines 37 & 38. It's really just one line.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
@hbf
Forgive my ignorance but I dont think there is a line break between 37 and 38, unless you mean bring the } bracket up (line 38) to the same line as the rest of the code on line 37?
There was an error rendering this rich post.
oh, sorry i thought
was on line 38.
not sure why you have a line break between 'strong') and .'<span
you need to provide little more of the code to know where you are missing a bracket or semi-colon. maybe post the whole function.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
Sorry about this, I cant remember how I got the code to display with numbers again!? here is the whole of the code, line 38 is near the bottom you can see its the only line with just a } bracket on it.
There was an error rendering this rich post.
try just getting rid of the carriage return after 'strong')
it looks like everything is closed properly.
what's the purpose of the empty span class="count"? seems unnecesarry.
You could probably just get rid of that line and terminate line 36 with a semi-colon.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
by carriage you mean the
' '
empty spaces at the start of the line?the span class is doing its job by styling the categories section with a grey rectangle where the post count would have been. (the code I removed originally to get the error)
thank you for your continued patience!
There was an error rendering this rich post.
all the empty spaces and the new line (the result of hitting 'enter' on the keyboard) make it show as one line.
I'm just surprised you want the grey box without the number in it.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
the CR and white space shouldn't matter.... the parser is supposed to ignore that, but i'm trying to rule out the simplest thing first.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
ok so now it looks like this
the reason for the grey box without the number in it http://goo.gl/AwhTP - will give you a better idea. I think it suits the forum, criticism welcome though!
There was an error rendering this rich post.
here is the error log if that helps:
There was an error rendering this rich post.
ok.. i'll look into it a bit, looks like you are missing a parameter for one of the functions called in that line. my son just woke up so i can't look into it right now.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
There's PowerGrep for windows...
add this in your styles.css enjoy!
Note: provided you are using the default theme
ul.PanelCategories li.Depth2 span.Count {
color: #E3F4FF;
background: none repeat scroll 0 0 #E3F4FF;
}
ul.PanelCategories li.Depth2.Active span.Count {
background: #fff;
color: #fff;
}
ul.PanelCategories li.Active span.Count {
background: #fff;
color:#fff;
}
ul.PanelCategories li span.Count {
background: none repeat scroll 0 0 #E3F4FF;
color: #E3F4FF;
}
im sorry, but, i can't see anything wrong with the code. i;'ll try running it on my test site as well. falling asleep at the moment gotta go.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained