Nico Knoll Posted December 13, 2011 Share Posted December 13, 2011 Hi, the default comment form ($page->comments->renderForm()) only includes "name", "email" and "text" but I need an URL field so that the person who is commenting can add its URL. Is there a way to realize this? Greets, Nico Link to comment Share on other sites More sharing options...
ryan Posted December 14, 2011 Share Posted December 14, 2011 You'd probably want to make a copy of the FieldtypeComments and modify/rename it towards your needs. You'd need to change the DB schema that it uses so that you'd have a URL field, and then update the CommentForm class to accept it and save it. Basically, I'd just duplicate everything for the 'email' field to make a URL field. When it comes to sanitizing it, you'd just use the $sanitizer->url() rather than $sanitizer->email(). URLs are kind of open-ended in terms of what characters they allow, so make sure you run it through htmlentities() before outputting anywhere at runtime. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now