We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37286
    • 160 Posts
    Better late than never.

    Thanks
      • 38878
      • 255 Posts
      Any examples of adding a front end form to FAQ Manager for visitors to ask questions? I attempting to use formitdb as the schema is pretty simple, but I'm getting a class error:
      [2013-02-14 13:43:27] (ERROR @ /index.php) addPackage called with an invalid package name.
      [2013-02-14 13:43:27] (ERROR @ /index.php) No class specified for loadClass


      My Resource call looks like this:
      [[!FormIt? 
          &hooks=`spam,formit2db`
          &preHooks=`db2formit`  <-- tried with and with this prehook call, same result
          &prefix=`modx_` 
          &packageName=`faqman` 
          &tablename=`faqman_items` 
          &validate=` nospam:blank,question:required`
      ]]
      
      <h2>Ask a Question</h2>
      [[+fi.error.error_message]]
      <form class="form" action="[[~[[*id]]]]" method="post">
      <input type="hidden" name="nospam" />
      <input type="hidden" name="set" value="1"/>
      <label for="question"><span class="error">[[+fi.error.question]]</span> </label> 
      <textarea id="question" columns="50" rows="6" name="question" class="placeholder" placeholder="Enter Your Question">[[+fi.question]]</textarea> 
      <br class="clear" />
      <div class="form-buttons"><input class="button small" type="submit" value="Ask" /></div>
      </form>


      From what I can tell, this should work according to the schema. And I validated the table and field names in the db. Any assistance would be awesome.
        • 14784
        • 16 Posts
        Hey Harvey,

        Don't have any examples, but you are on the right path.

        Try this for your FormIt call:

        [[!FormIt? 
            &hooks=`formit2db`
            &packagename=`faqman`
            &classname=`faqManItem`
            &validate=`question:required`
        ]]
        


        Just adjust it for any extra hooks or validation you need. smiley
          • 38878
          • 255 Posts
          That did it. Replace table_name with classname and the correct class. Thx much!

          Quote from: josht at Feb 14, 2013, 10:18 PM
          Hey Harvey,

          Don't have any examples, but you are on the right path.

          Try this for your FormIt call:

          [[!FormIt? 
              &hooks=`formit2db`
              &packagename=`faqman`
              &classname=`faqManItem`
              &validate=`question:required`
          ]]
          


          Just adjust it for any extra hooks or validation you need. smiley
            • 46075
            • 2 Posts
            Hi guys,
            With the lack of documentation, I was wondering if anyone knew of a way to get the category titles out of faqman? Because right now we've got 8 categories and we are hard-coding the titles, under which we call faqman for each category. It'd be great if there was a way to call it once, and it would show the category title, then the Q/A for that, cat title, Q/A, etc...

            I did notice however that there is a categoryTpl param, but am not sure how to use it.

            Any help or guidance would be greatly appreciated, thanks.
              • 14784
              • 16 Posts
              Hi wiseolman,

              That was totally something planned that I forgot to put on the task list and it never got done. The categoryTpl param was supposed to be part of it.

              Right now the snippet only pulls out the items for the specified category/set. So the way you are doing it is "the way."

              I'm not sure how much time I'll have with the holidays coming up but I've added this to the issue list and will hopefully get to it soon.

              If you have any other problems or requests do feel free to report them on GitHub.
                • 4385
                • 372 Posts
                I have something that others using FAQ Manager might find useful.

                How to create a TV for associating FAQ sets to a resource.

                Create a new TV and name it "faqSet", with the caption "FAQ Set".

                For the input options use input type "Listbox (Single-Select)".

                Input Option Values
                @SELECT '-ALL SETS-' AS username, 0 AS id UNION ALL
                SELECT `name` AS `name`,`id` FROM `[[+PREFIX]]faqman_set`
                


                and Default "0"

                Output type: select "Delimiter" and use a comma ","

                I was thinking about using it to display a set of related FAQs for certain resources.
                  DropboxUploader -- Upload files to a Dropbox account.
                  DIG -- Dynamic Image Generator
                  gus -- Google URL Shortener
                  makeQR -- Uses google chart api to make QR codes.
                  MODxTweeter -- Update your twitter status on publish.