Show more than 1 testimonial in testimonial block

Permalink Browser Info Environment
Hi,

is it possible to show a specific number of testimonials in the testimonial block? I startet with the following code:

<?php           for ($i=0; $i<3; $i++) { ?>
<div class="bubble">
   <div class="bddj-simple-testimonial-extra">
                <?php     echo t($testimonialslist[$i]->extra) ?>
            </div>   
          <div class="bddj-simple-testimonial-testimonial">
                <?php      echo shortText($testimonialslist[$i]->testimonial, 200)?>
            <div class="clearfix"></div>
            </div>
         <div class="bddj-simple-testimonial-author">
                <?php      echo t($testimonialslist[$i]->author)?> 
            </div>
        </div>
<div class="bddj-simple-testimonial-company"><?php    if($testimonialslist[$i]->company=="Hochzeitscheck"){ ?><center><img src="http://v8.buch-dein-dj.de/download_file/14/0" alt="Unabhängige Kundenmeinungen von hochzeitscheck.de"></center></div> <?php    }


The problem is, that I get content in the first bubble and 2 empty bubbles. I think that the number of testimonials is limited in the controller.php of the block? I don't know how to change this. Can you help me?

Here is the page:http://v8.buch-dein-dj.de

Also I want the 3 bubbles to display in a row but that's another problem.

Type: Discussion
Status: Resolved
mst
View Replies:
edbeeny replied on at Permalink Reply
edbeeny
Try changing the following in hw_simple_testimonials/src/TestimonialSingleList.php


public function createQuery()
{
$this->query
->select('t.sID')
->from('bthwsimpletestimonial','t')
->orderBy('RAND()', 'DESC')
->setMaxResults(1);
}

to


public function createQuery()
{
$this->query
->select('t.sID')
->from('bthwsimpletestimonial','t')
->orderBy('RAND()', 'DESC')
->setMaxResults(3);
}

I have not tested but let me know if that has worked for you.

Ed
mst replied on at Permalink Reply
mst
It worked like a charm! Thank you!
edbeeny replied on at Permalink Reply
edbeeny
I've also updated this for c5 version 8.4+ I have added the option to show how many testimonials you want to show on the page.

concrete5 Environment Information

# concrete5 Version
Core Version - 8.0.2
Version Installed - 8.0.2
Database Version - 20161208000000

# concrete5 Packages
HonestWebsites Simple testimonials (1.0.0), Motif (0.9.3)

# concrete5 Overrides
blocks/hw_simple_testimonials/templates/bddj_testimonials/view.php, blocks/hw_simple_testimonials/templates/bddj_testimonials/view.css, blocks/hw_simple_testimonials/templates/bddj_testimonials, blocks/hw_simple_testimonials/templates, blocks/hw_simple_testimonials, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/es_PY/LC_MESSAGES/messages.mo, languages/es_PY/LC_MESSAGES, languages/es_PY, languages/en_GB/LC_MESSAGES/messages.mo, languages/en_GB/LC_MESSAGES, languages/en_GB, languages/nb_NO/LC_MESSAGES/messages.mo, languages/nb_NO/LC_MESSAGES, languages/nb_NO, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/cs_CZ/LC_MESSAGES/messages.mo, languages/cs_CZ/LC_MESSAGES, languages/cs_CZ, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/es_PE/LC_MESSAGES/messages.mo, languages/es_PE/LC_MESSAGES, languages/es_PE, blocks/hw_simple_testimonials/templates/bddj_testimonials/view.php, blocks/hw_simple_testimonials/templates/bddj_testimonials/view.css, blocks/hw_simple_testimonials/templates/bddj_testimonials, blocks/hw_simple_testimonials/templates, blocks/hw_simple_testimonials, languages/fi_FI/LC_MESSAGES/messages.mo, languages/fi_FI/LC_MESSAGES, languages/fi_FI, languages/es_PY/LC_MESSAGES/messages.mo, languages/es_PY/LC_MESSAGES, languages/es_PY, languages/en_GB/LC_MESSAGES/messages.mo, languages/en_GB/LC_MESSAGES, languages/en_GB, languages/nb_NO/LC_MESSAGES/messages.mo, languages/nb_NO/LC_MESSAGES, languages/nb_NO, languages/ru_RU/LC_MESSAGES/messages.mo, languages/ru_RU/LC_MESSAGES, languages/ru_RU, languages/sv_SE/LC_MESSAGES/messages.mo, languages/sv_SE/LC_MESSAGES, languages/sv_SE, languages/el_GR/LC_MESSAGES/messages.mo, languages/el_GR/LC_MESSAGES, languages/el_GR, languages/it_IT/LC_MESSAGES/messages.mo, languages/it_IT/LC_MESSAGES, languages/it_IT, languages/da_DK/LC_MESSAGES/messages.mo, languages/da_DK/LC_MESSAGES, languages/da_DK, languages/cs_CZ/LC_MESSAGES/messages.mo, languages/cs_CZ/LC_MESSAGES, languages/cs_CZ, languages/de_DE/LC_MESSAGES/messages.mo, languages/de_DE/LC_MESSAGES, languages/de_DE, languages/ja_JP/LC_MESSAGES/messages.mo, languages/ja_JP/LC_MESSAGES, languages/ja_JP, languages/pt_BR/LC_MESSAGES/messages.mo, languages/pt_BR/LC_MESSAGES, languages/pt_BR, languages/nl_NL/LC_MESSAGES/messages.mo, languages/nl_NL/LC_MESSAGES, languages/nl_NL, languages/es_PE/LC_MESSAGES/messages.mo, languages/es_PE/LC_MESSAGES, languages/es_PE

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
fpm-fcgi

# PHP Version
7.0.14

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, json, ldap, libxml, mbstring, mcrypt, mysqli, mysqlnd, odbc, openssl, pcre, PDO, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, redis, Reflection, session, SimpleXML, soap, sockets, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 16M
sql.safe_mode - Off
upload_max_filesize - 16M
ldap.max_links - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 2000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

Click below to request a refund for License #7944730. Assigned to buch-dein-DJ.de.
Created on Jul 18 2016 at 11:50 am
.