Build a Testimonial Widget for MODx using getResources

If you're in business, you know one the best ways to gain trust with your visitor  is to let your happy customers share their experience (hopefully positive).

What we'll need

 

Setup

I'll assume you have MODx installed, ready to go, most likely already in production.

First, let's create a container for your testimonials, start by making a resource in your web root, then create a child resource.

Testimonial Resource

You'll only need to worry about two fields:

Displaying the Testimonials

We'll start with the snippet call.

[[!getResources?
 &parents=`29`
 &tpl=`list-testimonials-tpl`
 &limit=`1`
 &includeContent=`1` 
 &depth=`0`
 &sortby=`RAND()`
 ]]


&parents  = the container ID
&tpl = chunk used  for each testimonial
&limit =  ony show one, change to 2 and see what happens 
&sortBy = Sort them randomly 

The Chunk

Goto your elements tab in MODx and create a chunk and name it "list-testimonials-tpl". Use the content below.

<div class="testimonial">
<h3></h3>
<div class="testimonial-content"></div>
</div> <!-- eof item -->

Making it work

Enjoy and post comments below.

 

Recent Posts

Improving MODX Page Speed for Google

Your website speed is impacting your bottom line , here are a few ways to improve it through browser caching, asynchronous loading of resources and other tips and tricks.

The Status of Liquid Web Cloud Sites Formerly of Rackspace in 2018

We've been a cloudsites customer since our inception, it's had ups and downs, here is what we think about it now.

OG Image Branding with phpThumb and MODX

Some of our clients have wanted to make sure their logo and branding appear in facebook, twitter, or messaging apps when shared. We came up with a clever solution.