Page 1 of 2
[SOLVED] Customer Testimonial
Posted: Tue Mar 31, 2009 7:00 pm
by runblip
I am looking for the best/most appropriate module to use for displaying a random testimonial. I need to be able to add entries, then display them randomly.
BlankoftheMonth seems to be a good candidate, not sure how I would randomize.
Any help would be much appreciated!
Thanks,
Nathan
Re: Random Customer Testimonial
Posted: Tue Mar 31, 2009 7:25 pm
by CMSmonkey
Maybe try the Random Quote tag (
http://dev.cmsmadesimple.org/projects/randomquote)
I have never used it before, but its description seems to fit your use.
Re: Random Customer Testimonial
Posted: Tue Mar 31, 2009 7:42 pm
by runblip
Thanks for the tip!
The advantage of using something like BlankoftheMonth is being able to manage the content in the admin area, as opposed to manually editing the text file.
Any other thoughts on randomizing how BlankoftheMonth calls it's content?
Re: Random Customer Testimonial
Posted: Tue Mar 31, 2009 7:57 pm
by CMSmonkey
For the Random Quote tag, if the quotes.txt document is stored in the uploads folder, then it can be retrieved from the Admin area under Content/File Manager. You just need to adjust the path file in the script.
Re: Random Customer Testimonial
Posted: Tue Mar 31, 2009 9:40 pm
by jmcgin51
How about the Quotes Made Simple module? I use this successfully on a site for exactly the purpose you are proposing. Allows backend editor editing rather than text file editing.
Here are the supported parameters from the module Help:
* (optional) lang="en_US" - Parameter is used to specify what language to use for display on the frontend. Not all modules support or need this.
* (optional) pickedby="random" - How to pick the quote among the candidates, allow values are 'random' (which pick a random quote), 'equal' (which tries to make sure all quotes are shown approximately the same number of times, 'day' (which selects the quote of the day maintaining that for 24 hours and not repeating it until all relevant quotes have been used
Note that this setting can be more or less relevant regarding the actualy source of the quotes.
* (optional) template="" - Use this template to show the quotes
* (optional) group="" - Only show quotes attached to this/these groups, should contain a groupname or more seperated by commas.
* (optional) quote="" - Only show specific quote(s) specified by their text-id, seperated by commas. This overrides the groups-parameter.
Re: Random Customer Testimonial
Posted: Wed Apr 01, 2009 12:31 pm
by runblip
The Quotes Made Simple module looks great. I installed that this morning and it randomizes and works well. One other question is how to provide a link to a page showing all Testimonials?
Thanks for all of the help so far
Re: Random Customer Testimonial
Posted: Mon Apr 06, 2009 8:02 pm
by runblip
I guess all I need to do here is display a SQL query for that part of the database. Can someone help me do that in a secure manner?
Thanks!
Re: Random Customer Testimonial
Posted: Mon Apr 06, 2009 8:35 pm
by jmcgin51
geez, I would have thought you could just customize the template with a {foreach} statement, but I can't make it work...
Here's what I was working on:
{foreach from=$items item=entry}
{$entry->quoteauthor} says:
"
{$entry->quotecontent}
"
from {$entry->quotereference}
(shown {$entry->quoteexposures} times)
{/foreach}
But this just returns a blank page. I think because the SQL query must return only one result, not an array.
Surely there is a way to do this, though, without a custom SQL query?
Re: Random Customer Testimonial
Posted: Tue Apr 07, 2009 5:38 am
by Nullig
Can you not use the quotes parameter, with all quotes selected:
* (optional) quote="" - Only show specific quote(s) specified by their text-id, seperated by commas. This overrides the groups-parameter.
quote="1,2,3,4,5,etc"
Nullig
Re: Random Customer Testimonial
Posted: Tue Apr 07, 2009 1:01 pm
by jmcgin51
but this means you have to edit the module call each time a new quote is added.
should have something like quote="all"
Re: Random Customer Testimonial
Posted: Tue Apr 07, 2009 5:49 pm
by runblip
jmcgin51 wrote:
but this means you have to edit the module call each time a new quote is added.
should have something like quote="all"
Something like that would be ideal
Re: Random Customer Testimonial
Posted: Thu May 21, 2009 6:18 pm
by runblip
runblip wrote:
jmcgin51 wrote:
but this means you have to edit the module call each time a new quote is added.
should have something like quote="all"
Something like that would be ideal
still need to get this working, any thoughts on getting this module to display all results?
thanks!
Re: Random Customer Testimonial
Posted: Thu May 21, 2009 7:39 pm
by JeremyBASS
I don't know how far your on this.. but I do the same thing but with news ... depending on what all I need I use
start=$Num
or
articleid=$Num
with
{capture assign=Num}{math equation='rand(10,100)'}{/capture}
{$Num}
just a thought as news is a very stable mod...
Cheers
jeremyBass
Technical Note: {math} is an expensive function in performance due to its use of the php eval() function. Doing the math in PHP is much more efficient, so whenever possible do the math calculations in PHP and assign() the results to the template. Definately avoid repetitive {math} function calls, eg within {section} loops.
Re: Random Customer Testimonial
Posted: Fri May 22, 2009 6:31 pm
by Jean le Chauve
For this site :
http://www.brightfuture.be i made a pseudo rotative testimonial on each page. Each time you refresh the page, you receive a new testimonial. I put into the gabarit :
Code: Select all
<!--Citation random-->
{capture assign='blobname'}citation{1|rand:6}{/capture}
{global_content name="$blobname"}
<!--Fin Citation-->
I create here 6 citations into 6 GCB (citation1, citation2... citation6) for all langage (MLE).
rand:number must be the same of your number of citations.
Re: Random Customer Testimonial
Posted: Fri May 22, 2009 6:38 pm
by JeremyBASS
@Jean le Chauve for what it's worth you made 3-4 extra queries going it the GCB way plus you still have the eval() hit ...
Another topic with 50 ways to skin the cat...
like
{news number='1' sortby="random"} that would work best of all IMHO...
Cheers
jeremyBass