Word Limit In Page Comments?

Hi Guys,



I am trying to put together a “25 words or less” style contest. Does anybody know a way to edit the length of words permitted in a page comment, so that people cannot go over 25 words?



Kind Regards!

[quote name='astrocas' timestamp='1398744414' post='182577']

I am trying to put together a “25 words or less” style contest. Does anybody know a way to edit the length of words permitted in a page comment, so that people cannot go over 25 words?



Kind Regards!

[/quote]



Unfortunately there is no way to set limit by words without additional customization. But you can use the “maxlength” HTML attribute which specifies the maximum number of characters allowed in the field.

[quote name='astrocas' timestamp='1398744414' post='182577']

Hi Guys,



I am trying to put together a “25 words or less” style contest. Does anybody know a way to edit the length of words permitted in a page comment, so that people cannot go over 25 words?



Kind Regards!

[/quote]



Hello astrocas,



As eComLabs suggests the easiest way is to limit the number of characters in page comments.

You can do it as follows (CS-Cart 4):



Open the file design/themes/basic/templates/addons/discussion/views/discussion/components/new_post.tpl



Find the line:






and change it like shown below:






Thus, we've added {if $runtime.controller=="pages"}maxlength="200"{/if} . It means that the number of charaters to input in a page comment will be limited to 200 characters.



Save the file and don't forget to clear admin cache to see the changes.



Best regards, Alt-team

Thanks very much guys!

[quote name='astrocas' timestamp='1398917493' post='182727']

Thanks very much guys!

[/quote]



You are welcome!