We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33238
    • 388 Posts
    OK, here we go!!!

    i have a list with the days of the week, and the client fill the list from a TV text output.

    Example:

    Monday: [*tvmonday*]
    Tuesday: [*tvtuesday*]
    etc...

    i assign the tv’s to the index template only, and i need that the list appear in that template and all another templates in the site.

    but the client modify the list just from one place, in this case, the index template.

    the problem is:

    the list is filled only in the index, in the other templates looks empty...

    i hope you understand me... i just need that the client fill the spaces in the index wen he change the content, and that informatios be showed in all the another pages.

    thank you so much!!! grin grin grin i hope you can help me!!! :’(
      --
      ysanmiguel.com
      • 3749
      • 24,544 Posts
      If I’m understanding you, you want the user to be able to edit the form (in the Manager) on pages that use the index template; and you want the results to appear in read-only form on all the other pages.

      It’s an interesting question. The only way I can think of offhand would be to use a plugin that listened to OnDocFormRender. It would have to check the value of the TV and create the read-only output for the page.

      Maybe someone else has a better idea.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 36404
        • 307 Posts
        Hi,

        i’m wondering if it wouldn’t be possible to use another TV for the other pages and, using an @EVAL in the optional output value, write a piece of code that would go and retreive the former one value ?

        have swing
          réfléchir avant d'agir
          • 4310
          • 2,310 Posts
          Wouldn’t something like this work?
          <?php
          $output = '';
          $myArray = $modx->getTemplateVarOutput(array('tvmonday','tvtuesday','tvwednesday','tvthursday','tvfriday'), XX);
          $output .= '<ul>';
          $output .= '<li>'.$myArray['tvmonday'].'</li>';
          $output .= '<li>'.$myArray['tvtuesday'].'</li>';
          $output .= '<li>'.$myArray['tvwednesday'].'</li>';
          $output .= '<li>'.$myArray['tvthursday'].'</li>';
          $output .= '<li>'.$myArray['tvfriday'].'</li>';
          $output .= '</ul>';
          return $output;
          ?>

          Where XX = the id of the page you’re editing the TV’s from.
            • 33238
            • 388 Posts
            grin grin grin grin YEAHH bunk58!!! Good One my Friend!!!

            your code works perfect!!!

            thanks a lot!!!
              --
              ysanmiguel.com
              • 4310
              • 2,310 Posts
              The power of MODx wink
                • 33238
                • 388 Posts
                My Friend, i have a question!!!

                i.m not the most powerful programmer... i.m nor programmer lol tongue tongue tongue

                i just need put this code using a table, is that possible???

                i made this but doesn.t work undecided can you help me please!!

                <?php
                $output = '';
                $myArray = $modx->getTemplateVarOutput(array('lunes','martes','miercoles','jueves','viernes','sabado','domingo'), 1);
                $output .= '<table>';
                  <tr>
                    <td width="74" align="right"><p><strong>Lunes</strong>:</p></td>
                    <td width="117">$output .= '<p>'.$myArray['lunes'].'</p>';</td>
                  </tr>
                  <tr>
                    <td align="right"><p><strong>Martes</strong>:</p></td>
                    <td>$output .= '<p>'.$myArray['martes'].'</p>';</td>
                  </tr>
                  <tr>
                    <td align="right"><p><strong>Mierc</strong>:</p></td>
                    <td>$output .= '<p>'.$myArray['miercoles'].'</p>';</td>
                  </tr>
                  <tr>
                    <td align="right"><p><strong>Jueves</strong>:</p></td>
                    <td>$output .= '<p>'.$myArray['jueves'].'</p>';</td>
                  </tr>
                  <tr>
                    <td align="right"><p><strong>Viernes</strong>:</p></td>
                    <td>$output .= '<p>'.$myArray['viernes'].'</p>';</td>
                  </tr>
                  <tr>
                    <td align="right"><p><strong>Sábado</strong>:</p></td>
                    <td>$output .= '<p>'.$myArray['sabado'].'</p>';</td>
                  </tr>
                  <tr>
                    <td align="right"><p><strong>Domingo</strong>:</p></td>
                    <td>$output .= '<p>'.$myArray['domingo'].'</p>';</td>
                  </tr>
                $output .= '</table>';
                return $output;
                ?>


                Thank you so much!!!
                  --
                  ysanmiguel.com
                  • 4310
                  • 2,310 Posts
                  <?php
                  $output = '';
                  $myArray = $modx->getTemplateVarOutput(array('lunes','martes','miercoles','jueves','viernes','sabado','domingo'), 1);
                  $output .= '<table>
                    <tr>
                      <td width="74" align="right"><p><strong>Lunes</strong>:</p></td>
                      <td width="117"><p>'.$myArray['lunes'].'</p></td>
                    </tr>
                    <tr>
                      <td align="right"><p><strong>Martes</strong>:</p></td>
                      <td><p>'.$myArray['martes'].'</p></td>
                    </tr>
                    <tr>
                      <td align="right"><p><strong>Mierc</strong>:</p></td>
                      <td>'.$myArray['miercoles'].'</p>;</td>
                    </tr>
                    <tr>
                      <td align="right"><p><strong>Jueves</strong>:</p></td>
                      <td><p>'.$myArray['jueves'].'</p></td>
                    </tr>
                    <tr>
                      <td align="right"><p><strong>Viernes</strong>:</p></td>
                      <td>'.$myArray['viernes'].'</p></td>
                    </tr>
                    <tr>
                      <td align="right"><p><strong>Sábado</strong>:</p></td>
                      <td><p>'.$myArray['sabado'].'</p></td>
                    </tr>
                    <tr>
                      <td align="right"><p><strong>Domingo</strong>:</p></td>
                      <td><p>'.$myArray['domingo'].'</p></td>
                    </tr>
                  </table>';
                  return $output;
                  ?>
                    • 33238
                    • 388 Posts
                    grin grin grin Perfect...

                    Thank you so much my friend!!! laugh

                    you are really good doing this!!!
                      --
                      ysanmiguel.com