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

Displaying latest thread on the front page?

I was wondering if it was possible (perhaps an addon?) to have the latest forum thread displayed on the home page of the forum.
Sorry I'm still relatively new to vanilla and don't know much about coding.

Comments

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    This would be possible, but I couldn't think of any nice way to represent it to the user. What is your home page? /categories? /discussions? Imagine it is a discussion with multiple pages - would it really be useful to show that discussion beneath a list of 30 recent discussion?
    Maybe you could post a draft of what you are thinking of

  • Options
    hgtonighthgtonight ∞ · New Moderator

    Do you want only the latest thread on the home page?

    Extend the discussion controller and only grab the last used discussion. Set the view to be the index and no extra coding/theming should be necessary.

    If you are looking to see a list of posts on the frontpage in the side bar, check out Latest Post List here: http://vanillaforums.org/addon/latestpostlist-plugin

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    R_JR_J Ex-Fanboy Munich Admin
    edited June 2014

    @xskillz said:
    don't know much about coding.

    @hgtonight said:
    Extend the discussion controller and only grab the last used discussion. Set the view to be the index and no extra coding/theming should be necessary.

    Not quite sure if I understand that... :lol:

  • Options
    hgtonighthgtonight ∞ · New Moderator

    Starting code below to explain what I said:

    public function DiscussionController_Latest_Create($Sender) {
      $Sender->View = 'index';
      $Discussions = $Sender->DiscussionModel->Get(0,1)->Result();
      $Discussion = $Discussions[0];
      $Sender->Index($Discussion->DiscussionID);
    }
    

    Now we have a Vanilla path at '/discussion/latest`. It pulls the last discussion via the model and calls the index function. We set the view explicitly so we don't have to create our own theme.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Clever! I thought it should be shown additionally to something else - which wouldn't make much sense - but your solution looks like it should be made a small plugin

  • Options

    @hgtonight
    thank you. I was looking similar to that.

Sign In or Register to comment.