Using Quip with MODX
Posted by Mike Nuttall
How to set up Quip with MODX for page commenting on your website.
Calling the snippets
If you want commenting on your MODX website you can use Quip.
For these instructions I'm using Revo 2.2.8 and Quip 2.3.3. This is a quick simple example using mostly the default settings.
First of all you need to put the following code, or similar, on the page to which you wish to enable comments.
<div id="comments" class="post-comments"> [ [ !Quip? &thread=`LeedsThread` &threaded=`0` &useCss=`0` ] ] <p class="addComment"></p> [ [ !QuipReply? &thread=`LeedsThread` &moderate=`1` ] ] </div>
You use two Quip snippets "Quip" and "QuipReply".
The first call will output any comments that have been made already.
In this example I have called the thread "LeedsThread":
&thread=`LeedsThread`
This will identify the thread.
I've also chosen to have one comment after another rather than threaded comments just because it's simple, and I like to keep it simple! :
&threaded=`0`
And I want to format the comments myself in my own css file so I don't want Quip adding its default CSS file:
&useCss=`0`
Then we come to the reply form itself which is created by QuipReply. We identify the thread again as "LeedsThread". We want to moderate the thread:
&moderate=`1`
OK, commenting should now work, you will need to play with your css files to get it to look how you want.
Changing the time displayed on the comments
If the time displayed on your comments is incorrect go to System => System Settings
Where it says "Search by key..." type "date_timezone" you can then change this setting to the appropriate timezone.
You can find all the choices of timezones on the php.net pages
Changing the email settings
Your emails though will come from "Quip", which isn't going to mean much to the people commenting on your clients' websites, so you probably want them to come from "Your Website Name".
This is easily done: Go to System => System Settings then change core to quip you will now see the settings related to the emails that get sent to the commenters:
"Allowed Tags", "From Email", "Reply-To Email", "To Email" and "From Name for Emails"
Change these as appropriate for your website.
Changing the subject and body of the automated emails
The final thing you might want to do is change the subject and body of the automated emails that are sent. By default the emails have [Quip] in their subject line and the sign-off of the email which isn't going to mean anything to people other than those that know MODX.
Unfortunately this isn't yet contained in a template so it involves hacking a Quip core file. It's not a serious code file though so there's no need to get too worried, just keep a copy of it (your new version) so that when you update Quip, and your new file gets overwritten, you can replace it again with your new version.
The file in question is: core/components/quip/lexicon/en/emails.inc.php
It's just a list of array elements that contain the HTML templates for the various emails sent, so adapt it to the needs of your website, and as I said keep a copy.
I was wrong about that! You can get rid of "Quip" from your notification emails by changing the Lexicon settings in the manager.
Go to System > Lexicon Management then select Namespace > quip and Topic > emails , then you can change the email templates from here. Double click on the ones you want to change.
Go to the manual pages for Quip to find out what else can be done.
Say NO to another stylesheet!
By default Articles adds the quip stylesheet (assets/components/quip/css/web.css) onto the end of the HTML header.
I don't like this for two reasons:
- It's another file for the browser to download, 1 css file should be enough
- It adds lots of css that you haven't written yourself, so you will end up having to fight it to get the look that you want. I think it's better to start from scratch and build your own styles, so you have a better chance of avoiding conflicting rules, and redundant css
[need to add note on disabling css with just vanilla quip]
Aruan
Sep 05, 2013 at 01:36 AM
Thanks!
It's really sad that the actual Quip manual is not so friendly as your short tutorial.
Mike Nuttall
Sep 05, 2013 at 11:28 AM
Hi Aruan, glad you found the tutorial useful. I think sometimes it helps to see some step by step instructions presented in a different way than the manual to help figure something out. All the stuff is there in the manual, I wrote this article as a note as a quick reminder of how to get everything set up.
Dulce
Oct 18, 2013 at 11:36 PM
Are there some way to disappear the Preview button?
Thanks!
Mike
Dec 12, 2013 at 02:36 PM
Hi Dulce, Yes you can disappear the preview button. add the argument &tplAddComment to your QuickReply snippet call. Then create your own template based on http://rtfm.modx.com/extras/revo/quip/quip.quipreply/quip.quipreply.tpladdcomment but without the Preview button. But why would you want to do that?
Edward Kufoba
Sep 03, 2014 at 01:59 PM
Thanks so much. Keep up with the good work.
Thijs Van Damme
Sep 29, 2015 at 06:46 PM
Notify me of new replies is not working on my site? Any idea why?