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.
Remove Title
finanssans
New
Hi. I want to show the question itself, and not just the title on the main page. I also want to remove "title".
Heres is some examples:
Thanks for all help i can get!
0
Comments
How about changing "Tittel" to "Sammendrag" instead? Or "Spørsmål" for that matter if it makes more sense.
Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub
but that does not help if i want the users to see the actual question, not just a title.
What it would do is encourage them to type in the actual question as the title
Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub
That could work. But then i still got two boxes, and that is confusing for the visitors. It must be something i can change so that it displays the question and not the title, but i can't seem to find it.
Display Discussion body instead of Title
Modify your theme to display the discussion body. In file vanilla/views/discussions/helper_functions.php, replace
with
Remove Title field from the New Post form
Title is a required field, it cannot be left empty. You can hide it using CSS, if you like, but you must then implement a handler for
DiscussionModel::BeforeSaveDiscussion
event to fill it before saving the Post.Example (untested)
Suggestion
If you combine the two solutions, you can solve both problems in one shot, with less work. Here's what you could do.
1- Hide the Discussion Title from the New Post with CSS
2- Transform the Discussion Title into an excerpt of its body
This way, you do not need to change vanilla/views/discussions/helper_functions.php. The Discussion title will be displayed as usual, but it will contain a snippet of the body.
My shop | About Me
it is possible to do with a plugin or themehook. You would have to format the substituted title as Text only and truncate it.
You could use
DiscussionModel_BeforeSaveDiscussion_Handler
You would change the
Name
field e.g.$Args['FormPostValues']['Name'] = SliceString(Gdn_Format::Text($Args['FormPostValues']['Body']),100);
You could then hide the form field.
That is pretty much all the help I can give you.
grep is your friend.
Thank you so much businessdad! It now displays the body. Great! I think i can stick with the title after all.