On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • NOTE : this post has been translated with google translator


    The file containing the snippet is here. :

    Before using tvExplorer you have to install tvEditor Module

    What is tvExplorer?

    tvExplorer offers you to create very easily advanced search forms combining fulltext, document tree and tvs.
    The list of results is generated with ditto.

    Sample form using tvExplorer:


    Obligatory parameters:

    &dittoName => the name of the snippet ditto to be used
    &dittoSnippetParameters => parameters of ditto
    They must be written in the form
    param: value|param: value
    &formTPL => name of the chunk containing tvexplorer tags


    To activate tvexplorer you must give to your submit the value “search”.
    If you use the parameter &tveID, think of adding like prefixes the value of &tveID followed “_” to the value “search”
    Ex: &tveID= `tvx `=><input type="submit" name="tvx_search" />.

    Optional parameters:

    &tveID => for multiple calls of the snippet in the page, this parameter makes single each form.
    You will have to add this value like prefix followed by “_” in front of each placeholder placed following the call.
    Ex: &tveID= `tvx `

    &extraTVs => If in your/your chunks Ditto you use the placeholder [+tagLinks+], extraTVs enables you to post tvs which do not form part of the form.
    They will have passed to ditto via tagData.

    &cssStyle => list of files css (separated by a comma) to include in the head document.

    &jScript => list of files js (separated by a comma) to include in the head document.


    Syntax to use to build a tag is as follows.


    Tags for the tvs

    - Properties of the tags tvs

    • tvtype: which type to apply to the for frent end rendering
    • fullText: activate full text search on this tv
    • filter: which filter to apply
    • filterOff:
    • label:

    - The method #RANGE
    here is a sample using the range Method

    The form element before applying the range method

    once the range is applied

    Some explanations
    The tv type in DB is number

    [+tve.ObjectPrix:#RANGE{tvtype->dropdown:label->Votre budget (prix max.):elements->@Chunk intervalPrix:filter->4}+]

    tvtype->dropdown => we are changing the tv type from number to dropdwon
    elements->@CHUNK intervalPrix => as tv type in db is number there are no options so we’re creating them by calling @Bindings (all are supported @EVAL @SELECT @DIRECTORY plus one I creatd @TV)
    In this sample the chunk contains
    Moins de 15€==15||Moins de 50€==50||Moins de 80€==80||Pas de limite==9999
    filter->4 the filter to apply

    If you need to have two elements in your range you have to separate the properties with ||

    [+tve.tvname:#RANGE{from || to }+]

    Special tags

    - Properties of keywordsSearch

    • searchStyle
    • label
    • excludeTVs
    • includeTVs

    to supplement


    parentElt is used to restore the tree of documents in the form of its choice to offer to the visitors faculty to restrict research with a folder and its children in particular.

    Ex of tag: [+tve.parentElt: type->select: start->10,15: depth->2,3: label->Choisissez a heading: blankLabel->-+]

    - parentElt Parameters

    • start: list ids of the folders which you wish to post separated by a comma.
      Ex: start->5 or start->5,14,47
    • depth: fix the depth for each folder contained in the list start.
      You can define a depth for each folder
      Ex: start->5,14,47: depth->2,3,1
    • excludeStart:
    • hideFolders:
    • type: the type of element has to use in the form (checkbox, dropdown/select, radio/option)
      The denomination modx and HTML are supported
    • label: The text contained in the beacon <label>
      Ex: label->Mots Key
    • blankLabel: for the selects/dropdown you can determine the text to post in the first empty value.
      blankLabel->sélectionnez a value
    • addBlank: If you wish to activate/decontaminate the first value select empties (by defect the value is 1)
      Ex: addBlank->0 one decontaminates the inclusion of the first option empties select.


    Ex of tag: [+tve.dateElt:source->createdon:name->dateCreation:filter->dateFilter: label->Créé le+]

    * source
    * name
    * dateFormat
    * dateSplitter
    * filter

    The system of templates

    - Chunks by type

    At the time of the installation of the module tvEditor, chunks by defect will be installed for tvExplorer.
    Here contents of each one of them.
    I will standardize their contents for next the release.
    The construction of each input is carried out by using the class MakeForm de Jason (OpenGeek)
    I will return later on the régles of substitution of the placeholders of the MakeForm class.

    to supplement

    <label class= " checkbox " [+for+] ><input class= " checkbox " type= " checkbox " [+id+] name= " [+name+] “[+value+] [+size+] [+checked+] [+disabled+] [+style+] [+events+]/> [+label+] </label>


    <label class= " [+required+] [+optional+] [+className+] “[+for+] > [+label+] </label>
    <input type= " text " [+id+] name= " [+name+] “[+value+] [+size+] [+maxlength+] [+readonly+] [+disabled+] [+class+] [+style+] [+events+] [+onclick+]/>


    <input type= " [+type+] “[+id+] name=” [+name+]” [+value+]/> [+extra+]


    <label class= " select [+required+] [+optional+] [+className+] “[+for+] > [+label+] </label>
    <select [+id+] name= " [+name+] “[+size+] [+disabled+] [+multiple+] [+class+] [+style+] [+onchange+] >


    <option [+value+] [+selected+] > [+label+] </option>

    note: this one will have to be modified in the new version of tvexplorer (<label> badly placed)

    <input class= " radio " type= " radio " [+id+] name= " [+name+] “[+value+] [+size+] [+checked+] [+disabled+] [+style+] [+events+]/>
    <label radio class= " [+required+] [+optional+] “[+for+] > [+label+] </label>

    - Personalized chunks
    to supplement


    - To place after the call
    to supplement



    - To place in the chunks
    to supplement



    The code of the chunk &formTPL

    <form action= " [~[*id*]~] “method= "get” >
    [+tve.keywordsSearch:excludeTVs->all:label->Mots clés+]
    <fieldset class= "sendForm" >
    <input type= "submit" name= "search" value= "Search"/>

    The call and placeholders

    [[tvExplorer? &dittoName=`Ditto`&formTPL=`formVin`&dittoSnippetParameters=`tpl: testPHX2|summarize:30|debug:1|paginate:1|depth:5|parents:23`]]
    <h3>nb documents: [+total+] </h3>
    <div id= " ditto_list " > [+tve.dittoList+] </div>
    <p class= " ditto_pagination " >Page <strong> [+currentPage+] </strong> of <strong> [+totalPages+] </strong></p>
    <p class= " ditto_pagination " > <span id= " ditto_pages " > [+previous+] [+pages+] [+next+] </span></p>

      Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
    • Hi heliotrope!

      I found the right forum for my questions smiley

      It seems I still have this problem:

      Fatal error: Call to undefined method MakeForm::fetch() in C:\Program Files\xampp\htdocs\096\modx-0.9.6\assets\modules\tvEditor\class\tveditor.class.php on line 1762

      here is my snippet call

      [!tvExplorer? &dittoName=`Ditto` &dittoSnippetParameters=`tpl:Katalogtpl|depth:1|parents:14|display:10` &formTPL=`sampleform`!]

      and here is my form chunk:

      <form action="[~[*id*]~]" method="get" >
      <fieldset class="sendForm">
      <input type="submit" name="search" value="Search" />

      So what am I doing wrong? I am testing this on a local apache network
      • Hi,

        never had this error before.
        your snippet call and your form are correct.

        I’m looking at the code and don’t find where the error could come from.

        I’ll be back in a couple of hour.
        If you are on line tonight join me on skype and we’ll try to fix this together.

          Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • hey there,

          sorry I was out but if your are still around, I don’t have skype but I am currently on messenger:



          guess we couldn’t get together tonight maybe tomorrow, i will be on messenger so hopefully we can work through this.
          • Issue solved.

            the version used by krypto was an older one posted in french forum.

              Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • Nice work Heliotrope,

              Thank you for assisting me to get this to work. here is my call:
              [[tvExplorer? &dittoSnippetParameters=`parents:6|tpl:ditto_aanbod_tpl1|tplAlt:ditto_aanbod_tpl2|displayArchive:0|summarize:999|total:999` &dittoName=`Ditto` &formTPL=`tve`]]

              and my form template:

              <form action= "[~[*id*]~]"method= "get" >
              <tr><td class="een">Kernwoord</td><td class="twee">[+tve.keywordsSearch:label->+]</td><td>
              <tr><td>Prijs van</td><td>[+tve.prijs:#RANGE{elements->@CHUNK priceList:tvtype->select:filter->3:label->:extra-></td>
              <td class="drie">||elements->@CHUNK priceList:tvtype->select:filter->4:label->Tot}+]</td></tr>
              <tr><td>In catogorie</td><td colspan="2">
              <input style="float: right;" type="submit" value="Zoek"  name="search" /></td></tr>

              and here you see the result:

              the tricky part was the split price tags but helio helped me with that.

                follow me on twitter: @dimmy01
              • Hi heliotrope~

                When I click submit all that happens is it appends values to the url:


                I assume ditto should be picking up these params and giving output but it seems it is not happening. Any ideas?
                • Hi,

                  if you don’t have FURLs enabled, you have to add an hidden field in your form to pass the id value.

                  <input type="hidden" name="id" value="[*id*]" />

                    Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                  • Great work Heliotrope! Nice to see public beta finally.. smiley I know you have done a lot work with this one and it is very much appreciated! This is an excellent resource to have in MODx.

                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • @krypto


                      To activate tvexplorer the submit name must be "search".
                      If you are using tveID param then you have to prepend the name with tveID + "_"

                      Your mistake comes from my sample code which is wrong.

                      So to fix your call

                      Change the submit name from tve_search to search

                      and add

                      <input type="hidden" name="id" value="[*id*]" /> in your formTPL
                      Mandatory when FURLS are off

                      sorry for this late reply
                      Thx for your support and testing during the development


                        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l