We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4295
    • 98 Posts
    Quote from: OpenGeek at Jan 16, 2006, 12:32 PM

    Ok, I thought you meant a real filesystem directory with lyrics, not a MODx folder. In this case, yes, you can customize the FlexSearchForm snippet to only look at specific documents...in fact some new features in the next release will allow users to configure the search form to only look at a specific list of documents, be they all the parents of the current doc, or all the children of the current doc, or whatever custom criteria you might come up with. Look at lines 314 and 325 in the current FlexSearchForm snippet, and you’ll see code like this....
    $sql .= "$tbl.published = 1 AND $tbl.searchable=1 AND $tbl.deleted=0;";

    You could simply add the following code to search a single folder (assuming a document id of 5 for the folder) in MODx...
    $sql .= "$tbl.published = 1 AND $tbl.searchable=1 AND $tbl.deleted=0 AND $tbl.parent = 5;";

    Jason, the code tweak you provided above is limited to a single folder. Is there a way to further tweak this to make FlexSearchForm search the child folders/documents within that folder also? Thanks.
      • 22815
      • 1,097 Posts
      Well, it’s just SQL there, so you’d have to change the = 5 to match each parent, eg

       AND ($tbl.parent = 5 OR $tbl.parent = 6 OR $tbl.parent = 7);
      


      But there may be a better MODx solution now.
        No, I don't know what OpenGeek's saying half the time either.
        MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
        Forum: Where to post threads about add-ons | Forum Rules
        Like MODx? donate (and/or share your resources)
        Like me? See my Amazon wishlist
        MODx "Most Promising CMS" - so appropriate!
        • 4295
        • 98 Posts
        I’ll have content in close to 50 child folders within a container folder -- so was hoping to just use a pointer to a single parent container folder. Is the "MODx solution" you alluded to a revised FlexSearchForm snippet, and if so, would there happen to be a beta available?
          • 22815
          • 1,097 Posts
          It was a genuine statement of ignorance rather than a deliberate allusion.

          Anyway. I’ve now done the few minutes additional research, and found HyperFlexSearchForm in the Repository.
          See: http://modxcms.com/HyperFlexSeachForm-768.html


            No, I don't know what OpenGeek's saying half the time either.
            MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
            Forum: Where to post threads about add-ons | Forum Rules
            Like MODx? donate (and/or share your resources)
            Like me? See my Amazon wishlist
            MODx "Most Promising CMS" - so appropriate!
            • 4295
            • 98 Posts
            Thanks, Paul. I just stumbled upon HyperFlexSearch myself. MODx has such a wealth of resources, it’s easy to miss something. Thanks again!