开发者

TYPO3: How to alert Number of Characters in RTE before save?

开发者 https://www.devze.com 2023-04-06 04:12 出处:网络
I am facing a problem with saving large 开发者_开发百科content in the backend. I want restrict the users with a mximum number of characters.

I am facing a problem with saving large 开发者_开发百科content in the backend. I want restrict the users with a mximum number of characters.

Before saving the record, I want to alert the user if the limit is exceeded.


The hard part is probably that it is richtext content that you are trying to save. So you can't really tell the user to remove some characters if the content is too big, because formatting will also count as extra space in the text field.

The easiest solution is to alter the field bodytext in the tt_content table of your Typo3 website. Make it of the type LONGTEXT, this can hold upto 4GB of content.

Another solution would be to hookup the save button, or add a custom save button that validates the content. You can find an extension adding a custom save button here: http://typo3.org/extensions/repository/view/marit_savedocemail/current/info/

See this file, that does the mailing (ie: would check the length): http://typo3.org/extensions/repository/view/marit_savedocemail/current/info/class.user_hook_t3lib_tcemain.php/

And this file, that adds the button: http://typo3.org/extensions/repository/view/marit_savedocemail/current/info/class.ux_alt_doc.php/

So what you could do is install this extension, see if it works, then alter it to your needs :)

Hope that helps :)

0

精彩评论

暂无评论...
验证码 换一张
取 消