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 add the 'how to ask' information box when asking a new question on vanilla.org
I noticed that on vanillaforums.org when posting a new question there is an information box that appears to the right. the information changes depending if you have focus on
question title
ask your question
tags
how do I add one of these boxes, as this would be create to let my members know how to correctly post, as most of my users are non technical.
question title
ask your question
tags
how do I add one of these boxes, as this would be create to let my members know how to correctly post, as most of my users are non technical.
0
Comments
1. We override the post view by making a new file in the
[theme]/views/post/discussion.php
. The file was copied fromapplications/vanilla/views/post/discussion.php
.2. We added the help text in divs. Each div has the
Help
class as well as aHelp[FieldName]
class (ex. HelpTitle, HelpFormat, etc.).3. We added the following javascript to the page: We added this in the theme hooks file, but I think you can also just place the script in discussion.php file.
Hope this helps!
Todd, can you zip css and this file, please?
May be it is possible to integrete this in Vanilla, as it can be very useful if you could make hints specific to category (with subcategories, if any, having same hints).
every time I try to add the Java script to discussion.php I get an error. Help and assistance would be appreciated.
< div class="Help HelpFormat">2< /div >
< div class="Help HelpTags">3< /div >
To @ashleybacon , @tester13 , @iamonline , @smoigecom and everyone else, if you are still looking for this....
The info Todd gave was clear enough (at least for me). So, let me explain how I did it on my forum, step-by-step.
FIRST, PLEASE NOTE: You better know a good-level of CSS, otherwise it can be tough, and you'll end up wasting a lot of time. But I hope following my instructions will be easy for ya all.
[1] Copy discussion.php from '/vanilla-forum-root/applications/vanilla/views/post/' over to your custom theme — '/vanilla-forum-root/themes/YOUR-CUSTOM-THEME/views/post/'. (If the 'views' and/or 'post' don't exist already in your custom theme, just create them and drop discussion.php in.
[2] Now copying discussion.php into your custom theme as mentioned above means, you can edit the file (in your custom theme) as you wish, and it doesn't disturb the Vanilla core.
Open '/vanilla-forum-root/themes/YOUR-CUSTOM-THEME/views/post/discussion.php' and start following my further instructions.
NOTE: Now I am directly going to be adding CSS styles and JavaScript into 'discussion.php' and they will show up inside the
<body>
and not in the<head>
as we usually do. Why?Because these CSS styles and JavaScript are needed only on this page, i.e. the 'create a new discussion' page, and adding them unconditionally to the
<head>
tag all pages is unnecessary. Also because I don't know PHP, so I can't use PHP to show these CSS styles and Javascript only in the header of this page. If anyone does know how to do conditional output in PHP/Vanilla, please do share your solution.Also don't worry about SEO, and sh!t like that. Search engines cannot index this page unless you enabled guest posting, and even if you did, does it matter if this effing page is ranked low? lol! So, get over it.
Now, lets move on...
[2.a] Right above this:
Place this entire code:
[2.b] Right below this line:
Add this code block:
[2.c] The usual drill — save the file, and upload it back to your server (i.e. to '/vanilla-forum-root/themes/YOUR-CUSTOM-THEME/views/post/').
[2.d] That's it. Go check it out here — http://example.com/post/discussion/ (replace example.com with your domain) or http://subdomain.example.com/post/discussion/ (replace subdomain.example.com with your sub-domain) or http://example.com/forum/post/discussion/ (replace example.com with your domain, and forum with your sub-directory) — based on how you installed Vanilla.
Hope that was clear enough. Happy modding!