Hi there...
I'm using Quip 2.3.2 in Modx Revo 2.2.4...it's working fine so far, only the website link (if a user enters a Website in the input/comment-form) is broken.
Example:
The Quip-comment function is implemented on the site www.mydomain.com...
When a user enters "www.abc.de" and submits his post, the new comment is shown in the list as wanted. If you click on the users name, to visit his entered website, the link is broken like this:
www.mydomain.com/www.abc.de
Additionally I would like to add a "target="_blank" to the users link.
Thx in advance!
-
☆ A M B ☆
- 24,524 Posts
That's because the your base_url is added along with the protocol. If the user puts the full URL including protocol, http : / / www.abc.de then it will work as expected.
-
☆ A M B ☆
- 24,524 Posts
If he's entering this via a Rich Text editor, using the editor's Insert Link button should take care of the matter. But if he's entering it in a plain-text textarea, there isn't much you can do about it, unless Quip has events or post-hooks, in which case you could parse the content and fix any URLs in the content with a fairly simple regular expression.
http://stackoverflow.com/questions/2762061/how-to-add-http-if-its-not-exists-in-the-url
(the rtfm server is down at the moment or I'd do some research on quip).
I do this by using an additional validator (jQuery Validate) on the Quip form. It provides realtime feedback to the user entering info into the form, and if they start to type a URL using www, a red "error" appears below the field informing them that the correct format is "
http://www.example.com".