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.

Customizing the categories/discussion view

edited October 2011 in Vanilla 2.0 - 2.8
Vanilla is great ! I was looking for a forum for our small community, and I must admit this is a great improvement over traditional tools. My users love it so far, and it's only been a few days.

I'm trying to make the home page more readable and efficient. I found that displaying the activity on the right, and listing the categories with discussions is a pretty comfortable setup.

Now, I would like to limit the number of posts that show on the home page. Basically, what I have is this: - 10132011 - 03:06:43 PM.png

What I would like is:
* If a category has new discussions (either new post or new comment), show all of them below the category title
* if a category doesn't have any new comment, show the last 2 discussions only.

The goal is to reduce the length of the page, and still be able to scroll down, without missing any relevant information.

What would be the best way to achieve this ? If write a plugin or modify the code, could you give me some tips on where this would be best placed ? (I can code a bit of PHP, I just don't know my way around the source yet).

Thanks a million


  • Options
    ToddTodd Chief Product Officer Vanilla Staff
    I recommend letting the data load normally, but then remove rows based on your criteria in a plugin or your theme hooks. Here's something to get you started.
    public function CategoriesController_Render_Before($Sender, $Args) {
    if (!isset($this->CategoryDiscussionData))

    // var_dump($this->CategoryDiscussionData); die(); // see what's in the data.

    // Remove the discussions here.
    // ...
  • Options
    x00x00 MVP
    edited October 2011
    Todd I'm not sure I agree. For one, without filtering it first it might not be returning enough data within that limit, it is not so accurate. Secondly you still have to check as to whether there is new (which is based on his criteria as to what that entails). It shouldn't be an issue a where clause. So long as there are no joins performance should be fine.

    Also his is conditional of being the home page.

    grep is your friend.

Sign In or Register to comment.