We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7923
    • 4,213 Posts
    So.. is tvExplorer something that when you give TV names to it, it renders a form based on those TV types, just like how they show up in manager? And then it takes the input from the form and sends it to ditto?

    Hmm.. What I’m now thinking is that would it be possible to take the same code that generates the form, but make a snippet where you can give a template as parameter and it would check what TV’s are in it and make the form to input the info, then call docmanager to create a new document out of that. So it would be newspublisher that supports TV’s...


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 11975
      • 2,542 Posts
      Hi Doze,

      here is the documentation of tvExplorer
      It’s not up to date but the main settings are there.

      tvExplorer (tranlated by Lance)
      on line demo
      sample 1=> http://www.dixsix.fr/explorer/
      sample 2=>http://www.dixsix.fr/explorer/index.php?id=406

      What’s it for:
      tvExplorer is an extension for the module tvEditor. See => http://modxcms.com/forums/index.php/topic,7472.30.html TvExplorer permits the restitution on the front of tv’s (and their value options)depending on their type, in a search form.
      The results list is obtained with ditto.
      All of the filters representing the search criteria are automatically generated by TvExplorer,

      Only these tv types are supported:
      -text
      -checkbox
      -option
      -listbox-multiple
      -listbox-single
      -listbox
      -dropdown

      TvExplorer parameters:

      Html form output
      The form html is made with chunks,
      The form creation relies entirely on the class makeform by Jason(openGeek),

      &formTpl: The form chunk
      Must contain the following placeholders:
      [+action+] => url or id
      [+name+]=> form name
      [+method+]=> form send method
      [+tvEditorForm+] => Will be replaced by the form elements,

      Eg:
      Quote
      <form action="[+action+]" name="[+name+]" id="[+name+]" method="[+method+]">
      [+tvEditorForm+]
      </form>

      To produce the elements we will almost always use two chunks:
      one to wrap the series of elements,
      one to render each element,

      Eg: A series of checkboxes
      The wrapper &listCheckTpl, contains a placeholder ([+listCheckbox+]) which will be replaced by the tv options.


      &listCheckTpl:
      Quote
      <fieldset>
      [+listCheckbox+]
      </fieldset>

      Each checkbox is rendered using &listCheckItemTpl

      &listCheckItemTpl:
      Quote
      <label class="checkbox" [+for+]>
      <input class="checkbox" type="[+type+]" [+id+] name="[+name+]" [+value+][+size+][+checked+][+disabled+][+style+][+events+]/>[+label+]
      </label>
      [+extra+]



      Eg: A series of radio
      The wrapper &listRadioTpl, contains a placeholder ([+listRadioItem+]) which will be replaced by the tv options in the form of radio buttons.

      &listRadioTpl:
      Quote
      <fieldset>
      [+listRadioItem+]
      </fieldset>

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



      etc ...

      In short the parameters for form output are:

      &formTpl = Main form chunk

      - Tv type text
      &mitTpl = wrapper chunk element type="text"
      &inputTextTpl = render chunk element type="text"

      - Tv type dropdown, listbox
      &selectTpl = wrapper chunk element type="select"
      &optionTpl = render chunk element select options

      - Tv type checkbox
      &listCheckTpl = wrapper chunk element type="checkbox"
      &listCheckItemTpl = render chunk element type="checkbox"

      - Tv type option("radio")
      &listRadioTpl = wrapper chunk element type="radio"
      &listRadioItemTpl = render chunk element type="radio"

      // these last chunks will not be used
      // i will probalbly remove them in the final version
      &hiddenTpl = render chunk element type="hidden"
      &submitTpl = render chunk element type="submit"

      A series of chunks used by default comes with the module tvEditor,

      Filter management and personalization
      To determine the filters to use for each tv and add/overwrite/modify certain values we use a chunk &chunkExtra
      The creation of this chunk is obligatory for the snippet to work.


      The syntaxe to use in the chunk
      tv_name:property_name==property_value
      To change options, property_name must be prefixed by o_

      eg:
      tagsPhoto::filter==1::question==<h3>The photo must contain the following tags</h3>::o_className==required::o_onclick==some_js_function()


      To render "question" in the tv wrapper chunk we must add the placeholder [+question+]
      Quote
      <fieldset>
      [+question+]
      [+listRadioItem+]
      </fieldset>

      Selection of the tv’s integrated in the form and search:
      &selectTV= list of tv names separated by a comma
      Eg: &selectTV=`tagsPhoto,typeRecipe`

      Ditto Parameters
      &dittoName = Name of Ditto snippet to use
      The other parameters are from the ditto snippet.
      The parameters &tags, &tagData, &tagMode and &filter should not be incorperated into the call.
      These will be created by tvExplorer automatically.

      Example of use:
      For the correct operation of the snippet, the parameter values should always be wrapped with backticks(`) => param=`value`
      To incorporate the output of the form in your pages the placeholder should be just after the tvExplorer call,
      [+tve.searchForm+]
      The result list:
      [+dittoList+]


      Remarks:
      There is no debug or error management for the moment smiley
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 7923
        • 4,213 Posts
        By the looks of that, I think it should be possible to do a newspublisher type of front-end document publisher from tvExplorer quite easily that supports at least these tv types:

        -text
        -checkbox
        -option
        -listbox-multiple
        -listbox-single
        -listbox
        -dropdown



          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 11975
          • 2,542 Posts
          I thought about it but I’m afrait the code I’ve written is not enough flexible.
          It’s much too specific (I’m not a professional developer and that’s my second attemp of writing OO code)
          I will try in the next version to build a more reusable code.

          :-)
            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • 7923
            • 4,213 Posts
            No, I didn’t mean this snippet should be able to do both.. but it’s easy to create another one based on your work. Like you say, it’s much different, code wise also. I think it would be great resource for the community, along with this and the tvEditor. Looking forward to test these when you get them ready..


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 11975
              • 2,542 Posts
              Hi Folks,

              Still working on the module :-D

              I’ve added a new feature a kind of form builder to browse documents in the manager

              First => choose your template
              Second => choose the tvs you want to search
              Third => find the documents which matches your criteria

              Screenshots:

              Step 1



              Step 2




              Step 3



              And you can edit the tvs value from the list with QE



              I had to write some new filters, a ditto extender and a phx modifier.

              Now I’d like to add some ajax stuff beetwen the different steps.

              if anybody skilled in js code could lend me a hand I would really appreciate

              :-)
                Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                • 18397
                • 3,250 Posts
                AWESOME! Is the version in the screenshots available anywhere?
                  • 11975
                  • 2,542 Posts
                  Hi Mark,

                  Thanx for the kind comment.

                  I need to clean up the code but I can post a demo version.

                  :-)

                  By the way, would be really handy to get the tag delimiter in the filter class.

                    Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                    • 6726
                    • 7,075 Posts
                    Woosh I have followed this project a bit and I think this "GUI" is a major step toward extra powerful yet user friendly features (!), not to mention managing high document numbers much easily.

                    I am pretty much amazed too grin
                    And eager to test the beast wink

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


                      MODx est l&#39;outil id
                      • 11975
                      • 2,542 Posts
                      Hi folks,

                      I’ve finally succeeded in adding some ajax stuff in the form builder by using jquery and forms plugins.


                      Jquery rocks !!!!!

                      I will try to release a public version the next week .

                      We are currently testing it with perrine to fix the remaining bugs.

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