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

    if you wish to create a search form based on tv/parents/keywords on the front end, you need tvExplorer snippet.

    :-)
      Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
      • 10309
      • 14 Posts
      Sorry - i hurt my brain tonight - can you post a simple tutorial - how to make search form for front-end ?

      i try- but get error

      MODx encountered the following error while attempting to parse the requested resource:
      « Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’) GROUP BY tmp.id ORDER BY tmp.id ASC’ at line 1 »

      SQL: SELECT tmp.*,count(tcv.id) as total FROM `modx`.`modx_site_tmplvars` tmp LEFT JOIN `modx`.`modx_site_tmplvar_contentvalues` tcv ON tcv.tmplvarid=tmp.id LEFT JOIN `modx`.`modx_site_tmplvar_access` tva on tva.tmplvarid = tmp.id AND ( ) GROUP BY tmp.id ORDER BY tmp.id ASC

      i neet step-by-step tutorial .
      1. tvField
      2.template for ditto
      3. template for tvExplorer
      4. call on page (fro front-end)

      Big fnx if u do it for me...

      UPDATED
      Ooo.. i`m don`t understand - tvExplorer begin working after i delete Wayfinder from page template... Why???

      UPDATE 2
      Ok.. i found. error only in FireFox 2.0.0.14 ... Opera & IE - Ok.

      UPDATE 3
      Oh my... i found. lol. in firefox i`m logged in as site admin and as manager. BUT i think - it`s a BUG.

      *********************
      LAST UPDATE
      Ok. i found it at all. i`m get this error if i logged as `site admin` AND `in manager`.

      tveditor.class.php
      line #165

      if ($docgrp= $modx->getUserDocGroups())
      $docgrp= implode(",", $docgrp);
      $access= $modx->isFrontend() ? " " : " 1=’" . $_SESSION[’mgrRole’] . "’ OR ISNULL(tva.documentgroup)" . ((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)");

      if($docgrp) $sql .=" AND ($access)";

      ---------
      why $access= $modx->isFrontend() ? " " ... ?
      so i patched
      if($docgrp) $sql .=" AND ($access)";
      to
      if($docgrp&&($access!=" ")) $sql .=" AND ($access)";
        i`m a Russian man...
        • 11975
        • 2,542 Posts
        Hi,

        there certainly bugs in the code smiley
        That’s why it’s beta

        About tvExplorer (front end form) here are some explanations about how to use it.
        http://modxcms.com/forums/index.php/topic,16456.msg149311.html#msg149311

        Hope that helps

        :-)
          Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
          • 18367
          • 834 Posts
          Heliotrope,

          this looks great but I need some help with the install.

          Being a noob I need clear instructions. I get so far, I’ve unzipped it, out it in the folder, created the module but now what? The instructions seem to have missed some steps.


          INSTALLATION:

          Step 1:

          - unzip tvEditor.zip
          - upload in assets/modules/ the tvEditor folder (keep the name as it is=>camelCase)
          - Create a new module => tveditor
          Copy and paste this line in the content
          Code:

          include_once($modx->config[’base_path’] . "/assets/modules/tvEditor/tveditor.module.php");

          Do I save it now or just leave it?


          Step 2:

          In tvEditor/snippets/ You will find several snippets
          1/tvExplorer
          2/tve_splitPagination
          3/tve_AjaxSearch

          Install each of them, keep their name as mentioned above.

          How? Through the module, or just run them through the browser (which doesn’t work anyway?)Is there an install script?


          Add the extenders=> tve.extenders.inc.php et tvefilter.extenders.inc.php
          (they are in the ditto_extenders folder) in your assets/snippet/ditto/extenders.

          Again, how to add, where to add?

          These may seem like dumb questions, but we can only learn by asking.

          Oh, one more thing, in the module it says

          Install tvEditor

          Before using tvEditor, you have to install the required chunks.

          Where are they, what are they called?
            Content Creator and Copywriter
            • 11975
            • 2,542 Posts
            Hi,

            Do I save it now or just leave it?

            Yes save the module once you cpied and paste the code.


            How? Through the module, or just run them through the browser (which doesn’t work anyway?)Is there an install script?
            In resources>snippets:
            Create for each of the three a snippet.
            Copy and paste the file content in the text area and save it.

            Again, how to add, where to add?
            With your ftp client, browse the assets/snippets folder.
            Open the ditto folder.
            There is an extender folder, put the extenders there.

            Hope that helps.

            :-)
              Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
              • 18367
              • 834 Posts
              Ok,

              done all that, but when I press install I get this error message



              0 editable TVs in data base

              No Tvs were found.
              Note that only TVs which type is (listbox,listbox-multiple,checkbox,option,dropdown).

              ???
                Content Creator and Copywriter
                • 11975
                • 2,542 Posts
                If you don’t any tvs which kind is in the list (listbox,listbox-multiple,checkbox,option,dropdown), that’s normal.
                tvEditor aim is to edit tv options.
                So if you don’t have any tv that needs options it doesn’t display them.

                :-)
                  Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                  • 18367
                  • 834 Posts
                  OK, now you’ve lost me completely.

                  I was expecting to see tabs and options like you have in your screenshots for the install.

                  All I have is the error message and a blank screen.

                  Are you saying I have to create all of those tabs?

                  How do I do that?

                    Content Creator and Copywriter
                    • 18367
                    • 834 Posts
                    Alright, I figured out that the missing step is to edit the module and select Dependencies/Manage Dependencies and then add the snippets and chunks that you want.

                    At least that’s what i did and I got something to play with in the Tveditor.

                    But I’m still floundering as to how to put this all together.

                    Is there a user manual, tutorial or some examples or anything?

                      Content Creator and Copywriter
                      • 36624
                      • 535 Posts
                      Quote from: Soshite at Aug 20, 2007, 07:51 PM

                      Secondly, I’m getting htmlspecialchars error when I use the document list or the tv-Explorer sections.


                      Hello, this snippet is extremely useful but with Ditto 2.1.0 i have this error :
                      Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/www/.../web/stage/assets/snippets/ditto/classes/ditto.class.inc.php on line 1030


                      on line 1030 of ditto.class.inc.php :

                      $query[htmlspecialchars($param, ENT_QUOTES)] = htmlspecialchars($value, ENT_QUOTES);


                      just in case, my list box options are :
                      CHF 33 (tarifs reduits 22 / 15)  (€ 21 14 10)==CHF 33 (tarifs réduits 22 / 15)  (€ 21 14 10)||CHF 33 (tarifs reduits 22 / 15)==CHF 33 (tarifs réduits 22 / 15)||CHF 26 (tarifs reduits 17 / 12)  (€ 17 12 8)==CHF 26 (tarifs réduits 17 / 12)  (€ 17 12 8)||CHF 26 (tarifs reduits 17 / 12)==CHF 26 (tarifs réduits 17 / 12)||CHF 20 (tarifs reduits 14 / 10)==CHF 20 (tarifs réduits 14 / 10)||CHF 10 (tarifs reduits 7 / 5)==CHF 10 (tarifs réduits 7 / 5)||CHF 8==CHF 8.- CHF 8.- dès 22h||CHF 5==CHF 5||gratuit==gratuit


                      has im not a php coder i had to roll back to Ditto 2.0.2 to have tv-Explorer running ok.
                        CTRL+SHIFT+U - Clear Cache
                        CTRL+SHIFT+H - Hiding Heft Panel
                        CTRL+SHIFT+N - Fast Create Resource
                        CTRL+ALT+P - Preview Recource (in edit resorce window)
                        CTRL+ALT+S - Save