Category Archives Tutorials

mailchimp_modx2In this post we're going to go over how to get the MailChimp snippet set up and working on your MODx Evolution site.  MailChimp is a service that allows you to send email newsletters, manage subscriber lists, and track campaign performance.  You can of course simply create the forms and such directly in MailChimp and paste the supplied code into your site, but this little snippet works just great.  The directions I will outline here are also covered in the documentation inside the snippet folder, but I thought I would go over it for my own future reference and for anyone who may not be aware that this snippet exists or who may have had trouble setting it up.  I am using MODx Evolution 1.0.2 and will be setting this demo up on the Learn MODx website.

I've been using the default TinyMCE rich text editor that comes bundled with MODx Evolution on all my sites. Recently though, I've been a little dissatisfied with it and decided to try a different RTE.  Digging through the forums and the repository, I came across CKEditor as a possible alternative rich text editor. So far I've installed it on two client sites and it works fabulously! This little writeup walks through just the basics of how to install and set up CKEditor for your MODx Evolution site. (I am using MODx Evolution 1.0.2).

Part 0: Introduction Part 1: Write and Test the PHP Script Part 2: Create the Snippet Part 3 – MODx API, Placeholders, Chunks In the fourth part of this brief series on creating a custom MODx Evolution snippet, we're going to do some optimizing to make our snippet a little more efficient.  So far the snippet seems to be working as expected and is pulling in the feeds as needed.  However, it's a little inefficient.  The way things are set up now, every time someone refreshes the page, the script fetches a new copy of the rss feed from the coding pad, or whatever source you're pulling your feeds from. If you have a heavily trafficked site where people spend a lot of time on your site and visit many pages (thus, for example, constantly refreshing your snippet call in the sidebar), this can be resource heavy on both your side slowing your website down, and also on the web server that you're pulling the feeds from.  We can mitigate this by implementing caching.

Part 0: Introduction Part 1: Write and Test the PHP Script Part 2: Create the Snippet So far we have created the raw PHP script and tested the code outside of MODx.  We've started the process of transforming this script into the rssfeedFetcher snippet and we have it working on the Learn MODx website.  We've learned how to add optional parameters with default values to our call and everything seems to be working as expected. At the close of the last segment, I mentioned that our snippet is still relatively inflexible because the user has no control over how the output looks.  We're going to rectify this today by tapping a little into the MODx API to create placeholders and utilize chunks to allow for some templating and customization of the output.

Part 0: Introduction Part 1: Write and Test the PHP Script In the last installment of this brief series we went through the process of creating the raw PHP script that will form the basis of our snippet. We tested the code outside of MODx and it seemed to work pretty well. In this part, we're going to start the process of transforming this script into a MODx snippet.  As I said before, I will be working on the Learn MODx website that we built during the MODx Beginner series of tutorials.  My goal is to use the snippet to add one or maybe two sections of MODx related feeds to the sidebar of the website.  But first, we need to create the snippet itself, so let's get to work :)