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.
Display category title with the description and all discussions within the category
I’m trying to display the category description on the home page 'categories/discussions' however this home page only shows the category title and discussion, no category description. I have been having a look and the only page that seems display my category description is 'categories/all' however this doesn’t show the discussions. Can anyone help with this?
Tagged:
1
Comments
themes/[your theme name]/views/discussions/index.(tpl|php)
There is no example index.tpl but you can suss out what is available variable wise by putting a {debug} call in an empty index.tpl template. The simplest way to approach this is to view the source for that page as it is now and then copy that into the template and then convert it to use Smarty variables based on what you see in the {debug} popup. I am currently doing that myself though I have only just started.
If you go with a PHP version, you would need to replicate "applications/vanilla/views/discussions/index.php" and then adjust whatever helper functions / methods are called to grab and display the category description. If you are literally only adding the description, it will be embedded in a single function likely in the discussions "helper_functions.php" file.
I am currently working on the index.tpl file myself so will eventually have an example template I can share (likely a week away though).
Cheers
For example, I created a category called Travel and inside it two sub categories Hotels and Car Hire. If I only add discussions to the sub categories, Travel will show how many post in total in the sidebar but clicking on travel returns no results rather than showing all discussions from the sub categories.