• Resolved FionaS

    (@fionas)


    Hi! This plugin is brilliant. I’m wondering if it’s possible to add custom fields to it?
    Many thanks

    • This topic was modified 6 years, 11 months ago by FionaS.
Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author David Cavins

    (@dcavins)

    Hi @fionas-

    Yes, take a look at templates/docs/single/edit.php. There are a number of action points you can use to add new form fields. Then, you can save your custom field input using the bp_docs_after_save action hook.

    Best,

    -David

    Thread Starter FionaS

    (@fionas)

    Thanks David for your very prompt response. It is helpful but being a total amateur I will need to find someone with some php/plugin experience. I also have noticed several requests over time for being able to share with one person instead of group and I have seen your reply re: BuddyDrive which I downloaded and played with but not what I’m looking for. Also being able to create pdfs from the entries. Are these features currently being considered? I totally get that your time is on a volunteer basis but is there any scope for development of these features? or is there some other avenue I could pursue? Any advise or direction would be very gratefully received
    Regards
    a poor schmuck who has been thrown in the very deep end 🙂

    Plugin Author David Cavins

    (@dcavins)

    Hi @fionas-

    Yes, it’s true that once you get past configuration into customization, it does take some php experience. That said, anyone can learn to code. 🙂

    Re the other feature requests:
    Share with individual users: This is something we’ve talked about, but I have doubts about how well it would scale for large membership sites. We protect docs now using an exclusionary addition to most queries. For example, you’re on a page that has a “recent posts” widget; to keep recent docs out of the that widget, we have to specifically exclude them. For every type of sharing, it gets a little more complicated, until we’re finding the docs to exclude via several big queries. Tagging docs by member would add another demanding query, which could be a problem for people using inexpensive shared hosting. It’s an interesting idea, but I’m not sure how to solve the technical issues using the current approach.

    Being able to create PDFs: This is another good idea and would also help people who want a “printable” version of the doc. I’m not aware of any easy way to generate a PDF without using a (large) library that relies on unusual packages being installed on the server, which makes it tough to do in a plugin. If some way to get there exists, I’d love to do it, but it has to be an entirely portable bit of code, and I’m just not aware of any. (It would be cool, though.)

    Thanks for your feedback!

    -David

    Thread Starter FionaS

    (@fionas)

    OK that’s really good to let the ‘powers that be’ know – many thanks for taking the time to respond.

    Thread Starter FionaS

    (@fionas)

    Hi David Just to let you know I have been doing some PHP tutorials MySQL etc. So my question in response to your answer: “Yes, take a look at templates/docs/single/edit.php. There are a number of action points you can use to add new form fields. Then, you can save your custom field input using the bp_docs_after_save action hook.”
    I can see where I could add the new form fields but what table would that information be saved to? Do I need to create a table for the extra fields?

    Thread Starter FionaS

    (@fionas)

    Please ignore last message – I’ll figure it out 🙂

    Plugin Author David Cavins

    (@dcavins)

    Hi @fionas-

    I started writing up a small, generalized plugin that applies existing taxonomies to your BP Docs library. It might answer your need. At the least, it would be a good example to follow to see how to add new meta boxes to the docs edit screen and save them.

    This isn’t “finished” yet, but functionally I think it’s OK. Feel free to give it a try and let me know if you encounter any problems.
    https://github.com/dcavins/bp-docs-taxonomies

    -David

    block

    (@brandanhadlock)

    David,

    Thank you for creating that plugin! I appreciate it. I used the Custom Post Type UI to create two new taxonomies, then added instances of the taxonomies. (I don’t know what to call the instances. For example, I created Genres as a taxonomy and added Fantasy, Action, etc as the instances). I associated the two new custom taxonomies and also the Categories taxonomy to BP Docs from the Docs >> Taxonomies page. Now, on the Create Doc page, there is a row for each of those taxonomies. However, there is no way to select any instance of the new taxonomies, and for the Categories type, only “uncategorized” appears as an option although other categories exist. What needs to be done next so that the options will appear on the Create Docs page? Is that something you will be working on soon? Is that where the “templates/docs/single/edit.php” file still needs to be edited?

    Plugin Author David Cavins

    (@dcavins)

    Hi @brandanhadlock-

    Thanks for your feedback. I wasn’t including unused terms in the list of terms to add to the meta box (not on purpose, I just didn’t remember what the default behavior of get_terms() is).

    I’ve updated the git repository, so please grab the newest version and let me know if it fixes the problem:
    https://github.com/dcavins/bp-docs-taxonomies

    The only file that’s been updated is public/views/template-tags.php.

    Best,

    -David

    block

    (@brandanhadlock)

    David,

    Thanks for the quick work. The terms are now showing up as check boxes. That works great for my stages of writing taxonomy. However, for genres and subgenres, a stack of checkboxes is going to get long. Is it possible to have a multiselect dropdown, or at least to keep the checkboxes in a hierarchical alphabetical order? By that I mean that the child terms appear under the parent terms (and indented a bit) rather than all terms appearing in alphabetical order. I have a term and a child term that are both the same, so right now they appear one above the other in the stack of alphabetically arranged checkboxes, and the user won’t know to which parent the child belongs. I hope what I am asking for makes sense.

    block

    (@brandanhadlock)

    @fionas, With reference to printing to PDF, on my site I am using the TinyMCE Advanced plugin to enhance the visual editor. In the settings of the plugin, there is a printer button that can be dragged to the editor toolbar to enable it. After that, whenever a user is either creating or editing a doc, he or she can select the printer button (or go to the editor menu File >> Printer to print just the document. Even without the printer button enabled, when creating the original doc, a user can right-click in the doc area and select print to print just the doc. That doesn’t solve the problem for the reader, but perhaps it does provide a PDF for the author.

    Plugin Author David Cavins

    (@dcavins)

    Hi @brandanhadlock-

    It’s a good idea to offer some customization of the way the terms are shown, but I’m not going to have any time to add more functionality to this plugin anytime soon.

    As a user of the web, I do want to say that your suggestion of using a multiselect dropdown chills my heart, ha ha. (That’s the form element that I think shouldn’t have been included in HTML5.) 🙂

    -David

    Plugin Author David Cavins

    (@dcavins)

    @brandanhadlock: Please open an issue on the new plugin’s GitHub repo that details the customization that would be useful in the meta edit terms boxes. That way, your good suggestion won’t totally fall by the wayside:
    https://github.com/dcavins/bp-docs-taxonomies/issues

    Thanks again for the testing and feedback!

    -David

    block

    (@brandanhadlock)

    @dcavins, I added the issue to github as you requested. Also, I added an issue about an error message/warning that appears when trying to save a doc after a taxonomy has been selected. I think the doc still saves, but the error message appears and doesn’t go away until I manually tell the browser to go back.

    Thread Starter FionaS

    (@fionas)

    Hey thanks @dcavins and @brandonhadlock !!!!! I installed your plugin as suggested and it works well. It was just that I was wanting to add fields to the actual form itself eg some more text boxes and not add to the metboxes. I just wanted to know if there is a default wordpress table that I would store this info? eg the Postmeta table? Would that work?
    Thanks for everything you have done -it’s awesome

    • This reply was modified 6 years, 8 months ago by FionaS.
Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Feature Request: Adding Custom Fields to the Form’ is closed to new replies.