We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32963
    • 1,732 Posts
    Hi Everyone,

    I’ve just spent the better part of the day putting Beta 1 together. Please see my first post more information.

    And please remember to share your comments and feedback.

    The LOOP-WHILE tag is experimental. If you think it will be of any value then please let me know.
      xWisdom
      www.xwisdomhtml.com
      The fear of the Lord is the beginning of wisdom:
      MODx Co-Founder - Create and do more with less.
      • 25663 MODX Staff
      • 12,272 Posts
      Hey Raymond... Thanks for the update. Is this one merged with the current other fixes in SVN?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 32963
        • 1,732 Posts
        Quote from: rthrash at Jul 10, 2006, 03:49 PM

        Hey Raymond... Thanks for the update. Is this one merged with the current other fixes in SVN?

        Yes I think I have most of the fixes from SVN merged into beta 1. I’ll have to double check it later but it should much closer to being stable than before.



          xWisdom
          www.xwisdomhtml.com
          The fear of the Lord is the beginning of wisdom:
          MODx Co-Founder - Create and do more with less.
          • 6726
          • 7,075 Posts
          Thanks Raymond I’ll get down to testing this Beta grin !

          I’ll report as soon as I have performed a few test (I have a replica of a live production website to toy with, so it’s like a real test case).
          I’ll also read the updated doc smiley
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l'outil id
            • 32963
            • 1,732 Posts
            Many thanks David,

            So far I’ve managed to improve the output of the debugger to show tag-relationships when parsing a document.



            Other improvements due in Beta 2 includes

            * Two new types of snippets: Text-based and object-based snippets
            * Reduce siteCache file size by the removal of snippets, chunk and plugin code
            * Remove eval() when executing snippet.
            * Improve render time of cached files.
            * More performance improvements
              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.
              • 6726
              • 7,075 Posts
              Waow this is even better, the debugger will be a great learning tool on top of being a great helper to debug websites developpement !
              As a marketing guy, I see how this will be a definite plus for coders and designers alike smiley

              But enough talking, I am off to install this and test !


              Edit :

              Here is a test case which is causing me problems.
              I have a chunk used as a template for company data. Some of this data is sensitive and should only be accessed by identified web users. The idea is, use IF-GROUPS to display those sensitive informations to authorized users.

              Here is how I went about it :

              <h1>Fiche de la société "[*raison_sociale*]"</h1>
              
              
              <table class="fiche">
              
                <th colspan=2 class="coordonnees">Coordonnées</th> 
                 <!-- ligne 1  -->
                 <tr>
                    <td class="intitule">Raison Sociale</td>
                    <td class="valeur">[*raison_sociale*]</td>
                  </tr>
              
                 <!-- ligne 2  -->
                  <tr>
                    <td class="intitule">Adresse</td>
                    <td class="valeur">[*adresse1*]<br />[*adresse2*]<br />[*adresse3*]</td>
                  </tr>
              
                 <!-- ligne 3  -->
                  <tr>
                    <td class="intitule">Code Postal</td>
                    <td class="valeur">[*code_postal*]</td>
                  </tr>
              
                 <!-- ligne 4  -->
                  <tr>
                    <td class="intitule">Ville</td>
                    <td class="valeur">[*ville*]</td>
                  </tr>
              
                 <!-- ligne 5  -->
                  <tr>
                    <td class="intitule">Pays</td>
                    <td class="valeur">[*pays*]</td>
                  </tr>
              
                 <!-- ligne 6  -->
                  <tr>
                    <td class="intitule">Standard Téléphonique</td>
                    <td class="valeur">[*standard_tel*]</td>
                  </tr>
              
                 <!-- ligne 7  -->
                  <tr>
                    <td class="intitule">Télécopie</td>
                    <td class="valeur">[*telecopie_societe*]</td>
                  </tr>
              
                 <!-- ligne 8  -->
                  <tr>
                    <td class="intitule">Messagerie générale</td>
                    <td class="valeur"><a href="mailto:[*email_societe*]">[*email_societe*]</a></td>
                  </tr>
              
                 <!-- ligne 8  -->
                  <tr>
                    <td class="intitule">Adresse du site web</td>
                    <td class="valeur"><a href="[*site_web_societe*]" target="_blank" title="lien vers le site de [*raison_sociale*]">[*site_web_societe*]</a></td>
                  </tr>
              
              </table>
              
              <table class="fiche">
              
                <th colspan=2 class="financier">Informations économiques</th> 
              
                 <!-- ligne 9 -->
                 <tr>
                    <td class="intitule">Principaux Dirigeants</td>
                    <td class="valeur">[*dirigeants_societe*]</td>
                  </tr>
              
                 <!-- ligne 9bis -->
                 <tr>
                    <td class="intitule">Etablissements</td>
                    <td class="valeur">[*etablissements*]</td>
                  </tr>
              
                <!-- ligne 10 -->
                  <tr>
                    <td class="intitule">Activités et compétences</td>
                    <td class="valeur">[*activites_competences_societe*]</td>
                  </tr>
              
              [[:IF-GROUPS? &groups=`adherents` 
              
              &then=`<tr><td class="intitule">Chiffre d'affaires hors taxes total</td>
                        <td class="valeur">[*ca_ht_total*] €</td>
                     </tr>
                     <tr>
                        <td class="intitule">Chiffre d'affaires hors taxes Marine</td>
                        <td class="valeur">[*ca_ht_marine*] €</td>
                    </tr>
              
                  <tr>
                    <td class="intitule">Chiffre d'affaires hors taxes Naval France</td>
                    <td class="valeur">[*ca_ht_naval_fr*] €</td>
                  </tr>
              
                  <tr>
                    <td class="intitule">Chiffre d'affaires hors taxes Naval Export</td>
                    <td class="valeur">[*ca_ht_naval_export*] €</td>
                  </tr>
              
                  <tr>
                    <td class="intitule">Chiffre d'affaires hors taxes Maritime France</td>
                    <td class="valeur">[*ca_ht_maritime_fr*] €</td>
                  </tr>
              
                  <tr>
                    <td class="intitule">Chiffre d'affaires hors taxes Maritime Export</td>
                    <td class="valeur">[*ca_ht_maritime_export*] €</td>
                  </tr>
              
                  <tr>
                    <td class="intitule">Chiffre d'affaires hors taxes Sécurité Maritime</td>
                    <td class="valeur">[*ca_ht_securite_maritime*] €</td>
                  </tr>` 
              
              &else=`Les informations de CA sont disponibles <strong>aux adhérents</strong>, si vous êtes adhérents identifiez vous pour y accéder`]]
              
              </table>
              
              <table class="fiche">
              
                <th colspan=2 class="presentation">Présentation de la société</th> 
                <tr><td class="textuel">[*presentation_societe*]</td></tr> 
              
              </table>
              
              <table class="fiche">
              
                <th colspan=2 class="produits_services">Produits et Services</th> 
                <tr><td class="textuel">Ici liste de produits et service généré automatiquement à partir des fiches produit/service, avec un lien vers la fiche du produit/service, automatique</td></tr> 
              
              </table>
              


              At first I had called the "then" condition with &then=`[[$ChunkContainingSensitiveData]]` but as it didn’t work I put the content directly in the then clause I tried to put the content directly in it : same result -> Only the first row of the table is parsed when I am logged as a member of the "adherents" user group huh To be more precise, here is the outputed code of the then clause :

                <tr>
                    <td class="intitule">Chiffre d'affaires hors taxes total</td>
                    <td class="valeur">75 000 000


              You’ll notice the </tr> tag is not there... maybe that’s a clue ?

              Anyway, I tried to insert the "main" chunk code (i.e the whole table containing company info) directly into the template but same result. I tried to remove new lines in tag call, also tried to remove new lines in the table contained in then clause but no changes. I tried to call the IF-GROUPS uncached, but then it didn’t get parsed at all huh

              On top of that, some parts of the page (the image header and logo) didn’t load after I inserted the IF-GROUPS tag...

              If I look at how the IF-GROUP in the debug window here is what gets displayed :

              [[:IF-GROUPS? &groups=`adherents` &then=`  Chiffre d'affaires hors taxes total 75 000 000 €  Chiffre d'affaires hors taxes Marine 7 400 000 €  Chiffre d'affaires hors taxes Naval France 12 000 000 €  Chiffre d'affaires hors taxes Naval Export 15 000 000 €  Chiffre d'affaires hors taxes Maritime France 20 000 000 €  Chiffre d'affaires hors taxes Maritime Export 8 000 000 €  Chiffre d'affaires hors taxes Sécurité Maritime 250 000 € ` &else=`Les informations de CA sont disponibles aux adhérents, si vous êtes adhérents identifiez vous pour y accéder`]] 


              It is normal that the debugger strips html ?
              Does the parser also strip html ?

              Maybe I got the whole logic wrong here...





                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l&#39;outil id
                • 7923
                • 4,213 Posts
                Very nice features to look for! The loop tags will help much with templating too.. I’m especially waiting for the removal of eval(), will it allow remote debugging the snippets then? would be great!

                BTW, maybe obvious answer, but is this parser used in 1.0 too?

                @davidm
                I bet it’s the & character that’s causing trouble. You see there is &euro; htmlentity right after the point where the "result" is cut. Raymond posted about escaping & chars here. I don’t know will it work yet, but you could try.. Alltought I’m not sure if it’s the right way to "fix" this. Would seem odd that users need to escape all & chars manually when calling some html code from chunks etc. Maybe Raymond responds soon with better answers, this is just speculation..


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 32963
                  • 1,732 Posts
                  @doze,

                  You’re right on target with the &euro; entity. That’s exactly what’s causing the problem.

                  As for version 1.0 I think Jason is working on a recursive parser for the new core. I’m not sure if he will be using this version of the parser.

                  @david,

                  You need to escape the nested & characters by using \&euro;

                  The problem is that the parser currently does not auto-escape & characters that are passed to the tags. I’ll try to add the auto-escape feature to beta 2. With this feature the parser will have to decide whether or not it should escape &amp; or convert it to a & smiley
                    xWisdom
                    www.xwisdomhtml.com
                    The fear of the Lord is the beginning of wisdom:
                    MODx Co-Founder - Create and do more with less.
                    • 32963
                    • 1,732 Posts
                    David,

                    Here’s a quick patch for the parser. This adds the new auto-escape html entities feature.

                    Example:

                    [[$MyChunk? &value=`The fox &amp; the bird`]]

                    [[SnippetA? &amp;value=`The &euro; &amp; the US`]]

                      xWisdom
                      www.xwisdomhtml.com
                      The fear of the Lord is the beginning of wisdom:
                      MODx Co-Founder - Create and do more with less.
                      • 6726
                      • 7,075 Posts
                      (To forum admins : it’s strange but I have notification on for this thread and I don’t receive the emails... seems to do the same with all private forums, I just receive notification for public post. Is it just me ?)

                      Thanks Doze & Raymond for the lightning fast answer !

                      And thanks for the patch laugh You mean you implemented what you meant to do for Beta2 in such short time ? Or is it transitionnal fix ?
                      Anyway : that’s great !

                      Works like a charm grin

                        .: COO - Commerce Guys - Community Driven Innovation :.


                        MODx est l&#39;outil id