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 modify "View" for "Start new Discussion" Page in custom theme

fraxturefraxture
edited December 2013 in Vanilla 2.0 - 2.8

I'm trying to figure out how to modify the html for the Start New Discussion Page. I thought the way to do this would be to copy the .tpl file for this page into my theme -- assuming that that page is rendered using a view. But I can't seem to find a corresponding .tpl file. I tried grep -lr 'Form_Discussion to try to locate the file, but got nothing.

Comments

  • Most views (other than the master views) are actually php files. They can generally be located by going to /applications/{app_name}/views/{controller_name}/{method_name}.php.

    In your case, you are looking for the Vanilla application, on the Post controller, in the discussion method. So your view file is /applications/vanilla/views/post/discussion.php and you need to copy it into /themes/{your_theme}/views/vanilla/post/discussion.php. The next refresh should load the view from your theme at this point.

    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.

  • Thank you @hgtonight! Unrelated, is there a good tutorial/discussion somewhere that defines the various functions/roles of these different "applications"? This is one part of Vanilla's architecture that is still mystifying to me.

  • I remember writing something about it on the community wiki, but here is a quick breakdown of the four applications bundled in the Vanilla download:

    • Conversations: This handles the private messaging features. Your inbox, conversations, and new messages are all in here.
    • Dashboard: This is the meat of the Vanilla application suite. It handles user registrations, notifications (activity), logging, profiles, searching, stats, importing, configuration, etc. It really does a lot, which is why it can't be disabled through the GUI.
    • Skeleton: This is just an example application built on the Garden framework.
    • Vanilla: This handles all of the forum specific stuff. Categories, discussions, posts, drafts, and moderation.

    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.

  • @hgtonight said:
    Most views (other than the master views) are actually php files. They can generally be located by going to /applications/{app_name}/views/{controller_name}/{method_name}.php.

    In your case, you are looking for the Vanilla application, on the Post controller, in the discussion method. So your view file is /applications/vanilla/views/post/discussion.php and you need to copy it into /themes/{your_theme}/views/vanilla/post/discussion.php. The next refresh should load the view from your theme at this point.

    Could it be that the way to do this is to drop the vanilla part in /themes/{your-theme}/views/vanilla/post/discussion.php? So: /themes/{your-theme}/post/discussion.php. That's the only way I've gotten it to work...

  • I know there is quite a bit of flexibility built in to the theme overrides, but I thought I had split them up into application folders. Strictly speaking, controller names are going to be unique, so /themes/{your_theme}/views/{controller_name}/{method_name}.php should suffice. As long as it is organized and works, I don't think there is an issue.

    @tama, @phreak, and @vrijvlinder might be able to give you more insight on this.

    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.

  • You can modify the pages in a limited way. You can modify the controller/page however I have not had the need to do so since I rely on css and js mostly. If I knew what you wanted to do to the page maybe I could come up with a better way than hacking the master files.

Sign In or Register to comment.