Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6 is here! It includes security fixes and requires PHP 7.0. We have therefore ALSO released Vanilla 2.5.2 with security patches if you are still on PHP 5.6 to give you additional time to upgrade.
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

How can I increase the title length for discussions?

FiftyFifty New
edited June 2015 in Vanilla 2.0 - 2.3

The current max length is 100. I want to increase this to something like 200. Can that be done?

I've tried $Configuration['Vanilla']['Title']['MaxLength'] = '200'; but that doesn't work for this.

Thanks in advance!

Comments

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    I guess it is defined by the length of the "Name" column of the table GDN_Discussion. But if you increase that value, it would be decreased whenever you run utility/structure (which you should do after an upgrade).

    I know ways to reset that automatically but I guess it would trim all discussion titles to 100 characters every time...

    If no one else comes up with a better solution, you can make the db change and then, everytime before you run utility/structure, you have to make sure that you edit /applications/vanilla/settings/structure.php and change the column definition in that file from 100 to 200 for the discussion table. But that feels kind of ugly... :-/

  • I checked it and indeed it's a varchar(100) for the field Name. I'm a bit surprised by this, why shouldn't this default to 255 and be limited in the config file. Would be much better imho.

  • hgtonighthgtonight ∞ · New Moderator

    @R_J said:
    I guess it is defined by the length of the "Name" column of the table GDN_Discussion. But if you increase that value, it would be decreased whenever you run utility/structure (which you should do after an upgrade).

    I know ways to reset that automatically but I guess it would trim all discussion titles to 100 characters every time...

    If no one else comes up with a better solution, you can make the db change and then, everytime before you run utility/structure, you have to make sure that you edit /applications/vanilla/settings/structure.php and change the column definition in that file from 100 to 200 for the discussion table. But that feels kind of ugly... :-/

    If you write a plugin structure that makes the change, the field shouldn't be truncated to 100 and then increased, it should just stay where you want it. That is my experience, anyway.

    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.

    R_J
Sign In or Register to comment.