Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hello!

I have been working on a section that will have the Client Testimonials.

the code is:

Repeatable Region:
Code: Select all
</cms:repeatable>
    <cms:repeatable name='clients_speak'>
       <cms:editable
          name='start_date'
          label='Start Date (yyyy-mm-dd format)'
          desc='Enter date in yyyy-mm-dd format e.g. 2012-12-31'
          type='text'
          validator='MyEvent::start_date'
          separator='#'
          validator_msg='myevent::start_date=Incorrect date format'
          required='1'
          width='155'
      />
       <cms:editable name='client_name' label='Clients Name' type='text' />
        <cms:editable name='client_words' label='What the Client has to Say!' type='nicedit' />
   </cms:repeatable>


And to display it at front end:
Code: Select all
<cms:show_repeatable 'clients_speak' >
      <div id="dropcontentsubject"></div>
      <br />
       <div id='dropmsg0' class='dropcontent'>
      <div class="date">
               <strong><cms:show start_date /></strong>
                </div>
      <p>
                       <a class="link"><cms:show_repeatable client_name /></a>
                       <br><cms:show_repeatable client_words />
                 </p>
   </div>
</cms:show_repeatable>


The moment i enter the details:
1. Date
2. Client Name
3. Client Words
it gives me this error at the backend.



Please help!

Attachments

Image
where innovation meets technology
My intention is to be able to enter the following:
1. Date of posting the Clients Testimonial
2. Clients Name
3. Clients' Testimonial

This all occurs in a ticker that fades out and changes the three contents above to show that of another client.

The coding for that is:

CSS:
Code: Select all
/* Clients Speak */

#dropcontentsubject{
   width: 25%;
   font-weight: bold;
}

.dropcontent{
   width: 25%;
   height: 50%px;
   display: compact;
}


Javascript:
Code: Select all
<script type="text/javascript">
      /***********************************************
      * ProHTML Ticker script- © Dynamic Drive (www.dynamicdrive.com)
      * This notice must stay intact for use
      * Visit http://www.dynamicdrive.com/ for full source code
      ***********************************************/
      var tickspeed=5000 //ticker speed in miliseconds (2000=2 seconds)
      var enablesubject=1 //enable scroller subject? Set to 0 to hide
      if (document.getElementById){
         document.write('<style type="text/css">\n')
         document.write('.dropcontent{display:none;}\n')
         document.write('</style>\n')
      }
      var selectedDiv=0
      var totalDivs=0
      function contractall(){
         var inc=0
         while (document.getElementById("dropmsg"+inc)){
         document.getElementById("dropmsg"+inc).style.display="none"
         inc++
      }
      }
      function expandone(){
         var selectedDivObj=document.getElementById("dropmsg"+selectedDiv)
         contractall()
         document.getElementById("dropcontentsubject").innerHTML=selectedDivObj.getAttribute("subject")
         selectedDivObj.style.display="block"
         selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0
         setTimeout("expandone()",tickspeed)
      }
      function startscroller(){
         while (document.getElementById("dropmsg"+totalDivs)!=null)
         totalDivs++
         expandone()
         if (!enablesubject)
         document.getElementById("dropcontentsubject").style.display="none"
      }
      if (window.addEventListener)
         window.addEventListener("load", startscroller, false)
      else if (window.attachEvent)
         window.attachEvent("onload", startscroller)
   </script>


HTML:
Code: Select all
<h2 class="top-1">Latest Events</h2>
<cms:show_repeatable 'clients_speak' >
        <div id="dropcontentsubject"></div>
        <br />
            <div id='dropmsg0' class='dropcontent'>
             <div class="date">
                       <strong><cms:show start_date /></strong>
                  </div>
         <p>
                   <a class="link"><cms:show_repeatable client_name /></a>
                   <br><cms:show_repeatable client_words />
             </p>
   </div>
</cms:show_repeatable>


I also faced another problem, due to the id='dropmsg0'
In the script i am using the id's of each message change from 0,1,2,3......
but that also needs to be in the repeatable region. how to go about with that?
Image
where innovation meets technology
Please try the following:
Code: Select all
<cms:show_repeatable 'clients_speak' startcount='0'>
    <div id="dropcontentsubject"></div>
        <br/>
        <div id="dropmsg<cms:show k_count/>" class="dropcontent">
            <div class="date">
                <strong><cms:show start_date/></strong>
            </div>
        <p>
            <a class="link"><cms:show client_name/></a>
            <br/><cms:show client_words/>
        </p>
    </div>
</cms:show_repeatable>
The back end issue is another matter that perhaps KK can help you with.

Nevertheless, I can't help but think you should just be using a separate clonable template for your testimonials.
@cheesypoof: Thanks for the reply. The code you provided didnt work. I guess i have made some mistake somewhere.

what concerns me is the fact that, though we have defined the repeatable regions as:
Code: Select all
</cms:repeatable>
    <cms:repeatable name='clients_speak'>
       <cms:editable
          name='start_date'
          label='Start Date (yyyy-mm-dd format)'
          desc='Enter date in yyyy-mm-dd format e.g. 2012-12-31'
          type='text'
          validator='MyEvent::start_date'
          separator='#'
          validator_msg='myevent::start_date=Incorrect date format'
          required='1'
          width='155'
      />
       <cms:editable name='client_name' label='Clients Name' type='text' />
        <cms:editable name='client_words' label='What the Client has to Say!' type='nicedit' />
   </cms:repeatable>


Still at the back end i get to see that the clients name is in the date format (please see attached image).

whereas i intend to have a place where i can put the date manually, then the name of the client and then the clients testimonial. then why is it that i get the field of client name to show a date.

is it that the date coding that i have used has to have the start date and end date?

Attachments

Image
where innovation meets technology
@genxcoders,

Please use the following code for your repeatable regions -
Code: Select all
<cms:repeatable name='clients_speak'>
    <cms:editable
        name='start_date'
        label='Start Date (yyyy-mm-dd format)'
        type='text'
        validator='regex=/(?:19|20)\d\d-(?:0[1-9]|1[012])-(?:0[1-9]|[12][0-9]|3[01])/'
        separator='#'
        validator_msg='regex=Please enter date in yyyy-mm-dd format e.g. 2012-12-31'
        required='1'
        width='155'
    />
    <cms:editable name='client_name' label='Clients Name' type='text' />
    <cms:editable name='client_words' label='What the Client has to Say!' type='nicedit' />
</cms:repeatable>

Please let us know if this helps.
Thanks.
5 posts Page 1 of 1