To add the category description on the category page: - Create a custom theme - You have to customize a "views" file (see the Theme QuickStart page). In this case it's /applications/vanilla/discussions/helper_functions.php. You don't have to modify the original one, just copy it into /themes/Your_Custom_Theme/views/discussions/helper_functions.php. - Somewhere around line 100 you'll see this:
To add the category description on the category page: - Create a custom theme - You have to customize a "views" file (see the Theme QuickStart page). In this case it's /applications/vanilla/discussions/helper_functions.php. You don't have to modify the original one, just copy it into /themes/Your_Custom_Theme/views/discussions/helper_functions.php. - Somewhere around line 100 you'll see this:
I did this too, in the discussions view to show the description at the top of each category listing. I also did this to make formatting the description a little easier:
This allows *markdown* to be _used_ in the description to tart it up a bit, avoiding the need to add HTML tags (which affect the admin views of the categories).
Comments
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Create a custom theme
- You have to customize a "views" file (see the Theme QuickStart page). In this case it's /applications/vanilla/discussions/helper_functions.php. You don't have to modify the original one, just copy it into /themes/Your_Custom_Theme/views/discussions/helper_functions.php.
- Somewhere around line 100 you'll see this:
if (property_exists($Sender, 'Category') && is_object($Sender->Category)) {
?>
<div class="SubTab">↳ <?php echo $Sender->Category->Name; ?></div>
<?php
}
I replaced it with this:
if (property_exists($Sender, 'Category') && is_object($Sender->Category)) {
?>
<h2 class="DTPCategoryName"><?php echo $Sender->Category->Name; ?></h2><p class="DTPCategoryDesc"><?php echo $Sender->Category->Description; ?></p>
<?php
}
?>
And you can see the result here.
- Spam
- Abuse
1 · Insightful Awesome LOL ·- Create a custom theme
- You have to customize a "views" file (see the Theme QuickStart page). In this case it's /applications/vanilla/discussions/helper_functions.php. You don't have to modify the original one, just copy it into /themes/Your_Custom_Theme/views/discussions/helper_functions.php.
- Somewhere around line 100 you'll see this:
if (property_exists($Sender, 'Category') && is_object($Sender->Category)) {
?>
<div class="SubTab">↳ <?php echo $Sender->Category->Name; ?></div>
<?php
}
I replaced it with this:
if (property_exists($Sender, 'Category') && is_object($Sender->Category)) {
?>
<h2 class="DTPCategoryName"><?php echo $Sender->Category->Name; ?></h2><p class="DTPCategoryDesc"><?php echo $Sender->Category->Description; ?></p>
<?php
}
?>
And you can see the result here.
- Spam
- Abuse
0 · Insightful Awesome LOL ·And remove all the < br / > from the code, they were inserted by the forum here (< code > tag parsing bugs?)
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·Gdn_Format::To($sender->Category->Description, 'markdown')
This allows *markdown* to be _used_ in the description to tart it up a bit, avoiding the need to add HTML tags (which affect the admin views of the categories).
- Spam
- Abuse
0 · Insightful Awesome LOL ·Developer at Vanilla Forums, Inc. [GitHub, Twitter]
- Spam
- Abuse
0 · Insightful Awesome LOL ·- Spam
- Abuse
0 · Insightful Awesome LOL ·would have been great. but the code has changed. helper_functions.php is no longer what it used to be :-(
- Spam
- Abuse
0 · Insightful Awesome LOL ·aarch :( you 're right... I can't find this suggested code in the latest v2.0.18.4
Nobody could help us? thanks in advance
- Spam
- Abuse
0 · Insightful Awesome LOL ·yea trying to do that in the latest 2.1 version.... codes are not hte same
- Spam
- Abuse
0 · Insightful Awesome LOL ·