21-Mar-2014, 07:37 PM
I had to rapidly implement a comment title, if anyone else needs something similar, I hope this may help.
Due to time constraints, some functionality is missing. For example:
1. There is no option to toggle 'required'. I set it to required.
2. There is no option to set field length. I set it to 80 characters.
Obviously, you can implement this missing functionality yourself or complete the integration that I missed. You can also change the code to suit your needs.
You can toggle enabled or not in the backend. I used mostly the code from Steven and took over functionality from the Comment text area. For example, checking for injection, checking against the bad word list, etc. So if a user tries to enter anything like this in the Title field, the comment submission will be set to 'to be approved', as per the comment field.
I use bootstrap, so you may have to change some of the styling to suit, if you use the supplied CSS, but I guess if you are prepared to make the changes attached, you will know how to do this.
I also shouldn't need to remind you that this worked for me, it may not work for you, use at your own risk. Remember that these changes will be lost or mangled at the next update from Steven, and of course, backup all files you intend to change if everything goes pear-shaped, so you can set it back to the way it was.
Read the file through to understand what is happening before you make any changes.
Cheers
Lisa
Due to time constraints, some functionality is missing. For example:
1. There is no option to toggle 'required'. I set it to required.
2. There is no option to set field length. I set it to 80 characters.
Obviously, you can implement this missing functionality yourself or complete the integration that I missed. You can also change the code to suit your needs.
You can toggle enabled or not in the backend. I used mostly the code from Steven and took over functionality from the Comment text area. For example, checking for injection, checking against the bad word list, etc. So if a user tries to enter anything like this in the Title field, the comment submission will be set to 'to be approved', as per the comment field.
I use bootstrap, so you may have to change some of the styling to suit, if you use the supplied CSS, but I guess if you are prepared to make the changes attached, you will know how to do this.
I also shouldn't need to remind you that this worked for me, it may not work for you, use at your own risk. Remember that these changes will be lost or mangled at the next update from Steven, and of course, backup all files you intend to change if everything goes pear-shaped, so you can set it back to the way it was.
Read the file through to understand what is happening before you make any changes.
Cheers
Lisa