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
    Even If you don’t have tvs attached to your document(templates) tvExplorer can be handy.

    for instance you’d like to create a search form for your press release with some advanced features such as keywords and date ( published beetwen two dates).

    I will post a sample code to show how to build this kind of form.

    :-)

      Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
      • 11975
      • 2,542 Posts
      &formTPL=`pressform`


      <form action="[~[*id*]~]" name="tvExplorer" id="tvExplorer" method="get">
      <!-- If FURLS ARE OFF
      <input type="hidden" value="[*id*]" name="id" />
      -->
      <fieldset>
      [+tve.keywordsSearch:label->Keywords:searchStyle->partial:size->25+]
      </fieldset>
      <fieldset>
      [+tve.dateElt:name->debutdatePub:source->createdon:label->Created between:type->text:filter->3:size->10:maxlength->10+]
      [+tve.dateElt:name->findatePub:label->and :source->createdon:type->text:filter->4:size->10:maxlength->10:dateType->max+]
      </fieldset>
      <fieldset class="sendForm">
      <input id="tve_search" name="search" value="Search" type="submit">
      </fieldset>
      </form>


      And the snippet call


      [[tvExplorer?
      &formTPL=`pressform`
      &dittoName=`ditto202`
      &dittoSnippetParameters=`depth:5|tpl:tplPress|parents:11552|display:25|paginate:1`
      ]]
      [+tve.searchForm+] [+tve.dittoList+]


      The form output



      Some explanations:

      [+tve.keywordsSearch:label->Keywords:searchStyle->partial:size->25+]

      [+tve.keywordsSearch+] is a special tag. It creates an input field.
      If this field is filled tvexplorer will execute a modified version of AjaxSearch

      The params of keywordsSearch
      - label->Keywords (label for the input field)
      - searchStyle->partial (determine SQL statement)
      - size->25 (field size)


      [+tve.dateElt:name->findatePub:label->and :source->createdon:type->text:filter->4:size->10:maxlength->10:dateType->max+]

      [+tve.dateElt+] create a text to type date.

      Params are
      name -> name of the field (mandatory)
      source-> which field or tv to search
      filter-> ditto filter to apply
      dateType-> date method to calculate time stamp
      dateFormat -> the date format (dmy or ymd or mdy)
      dmy=> 12/07/2007
      mdy=>07/12/2007
      ymd=>2007/07/12
      dateSplitter -> / for instance if expected format is 12/07/2007



      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 22548
        • 58 Posts
        Wow! This looks great! And like: how could MODx ever exist without it? laugh

        And if you could manage to even build raum’s suggestions Quote from: raum at Jul 12, 2007, 11:43 AM

        this would be great!!!!!!!! I would love to add a preview of some text-tv´s to the document-overview ... and thumbs of the selected images ;-)
        into a future stable, this is exactly what will make MODx my one and only CMS!

        Thanks a lot for this, heliotrope!


          • 11975
          • 2,542 Posts
          I would love to add a preview of some text-tv´s to the document-overview ... and thumbs of the selected images ;-)

          in the module configuration:
          you can set the ditto Tpl (default value is = tve-dittoTPL)



          Look at the chunk code, duplicate the chunk and made the required changes to suit your needs.
          Once done change the chunk name in module configuration tab.

          :-)
            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • 22548
            • 58 Posts
            Great! I’ll try to dig into this smiley
              • 24530
              • 100 Posts
              I didn´t realize, that the ditto-template can already be changed, thought this was something for the future - but the future is now! thanks!
                my newest webpage [url=http://gitarren.zucali.at]Meisterwerkstatt f
                • 11975
                • 2,542 Posts
                As tvEditor and tvExplorer are using the awesome Ditto snippet, you can take advantage of PHx support.

                For your thumb you could use the phpthumb phx modifier => http://modxcms.com/forums/index.php?topic=14858.0

                and in your chunk

                [+myTVimg:isnot=``:then=`[+myTVimg:phpthumb+]`+]

                Not tested but should work

                :-)
                  Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                  • 16382
                  • 36 Posts
                  Hi!

                  This looks to me like a great module, but I am having a problem (maybe due to the fact I am still pretty new to all this),

                  I get this error:

                  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

                  This is my snippet call:
                  [!tvExplorer? &dittoName=`Ditto` &dittoSnippetParameters=`tpl:Katalogtpl|depth:1|parents:14|display:10` &formTpl=`tab-Form`!]
                  
                  [+tve.searchForm+]
                  [+tve.dittoList+]
                    • 11975
                    • 2,542 Posts
                    hi,

                    could you please post your form chunk?
                    And there is a typo in your formTPL param.

                    :-)
                      Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                      • 16382
                      • 36 Posts
                      Thanks for the quick reply...

                      Well, I guess my first problem is I don’t have a form chunk. I have two drop-down lists and one checkbox list. Do I have to create a form that duplicates my TV’s or is there some way to create a form using my TV’s. Sorry I realize I am still pretty new to MODx

                      P.S. Is the proper use of the &formTpl param then &formTPL?