Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter derweili

    (@h3p315t05)

    unfortunately i can not write php
    I can read and understand it a little bit but not write it.

    Plugin Author Brett Shumaker

    (@brettshumaker)

    Hi,
    Unfortunately, this would not be a quick, simple fix. You would definitely have to write some php to get the result you want. In the future, I may look at adding the ability for users to add their own custom fields, but it won’t be in the near future. πŸ™

    I think your best option would be to enter them into the bio field, which does accept HTML, so you could still style the extra information accordingly.

    Sorry I can’t help more.
    Brett

    a6april

    (@a6april)

    Hi Brett,
    Awesome plug in, lets say I know a little about php and want to go ahead and give it a try to add more custom fields. Where would I start playing around to do such a thing? Where did you add the existing fields?

    a6april

    (@a6april)

    wooowwweeee A little harder than I thought, it looks like you used the options table to add some of these and it is a little out of my league to make the attempt. I have changed some of the code, but I can’t get the short codes to work for new fields, I’ll wait for the update or if you have any short tips for me to pursue or head in the general direction I’ll get on it like a dog on a soup bone.

    Plugin Author Brett Shumaker

    (@brettshumaker)

    Hey a6april,
    I’m using Custom Post Types to build the Staff Member posts so it is not terribly difficult to add more fields. That all depends on your comfort level with Custom Post Types, of course. πŸ™‚ Justin Tadlock has a great tutorial on Custom Post Types if you need to get familiar with how they work. Just know that any plugin files you edit WILL be overwritten if you update the plugin. But here are some tips if you’re feeling adventurous:

    ** Go into admin-views.php and add the HTML for your new fields after line 27. Remember to prefix your field’s name/id with an underscore to ensure that they won’t show up as custom fields in a regular blog post.

    ** You’ll now have to make sure your new fields get saved when you update your Staff Member. Do this by adding the fields you created to admin-save-data.php after line 54.

    ** Add new template tags for your new fields to the arrays created in admin-install-uninstall.php on lines 113 OR 116. It will be easiest if you add your new tags to the end of the array.

    ** Now go into user-view-show-staff-list.php and tell the plugin what to do when it sees your new template tags. Add your HTML to the END of the arrays created on lines 113 and 116 (see notes below). You must have your HTML in the same order as you added your template tags in the step above. So, for example, if you added [staff-member-twitter-username] then [staff-member-facebook-url], you would need to add your twitter HTML and THEN the facebook HTML.

    *note – If you added a tag to line 113 of admin-install-uninstall.php then you’ll be working with line 106 of user-view-show-staff-list.php.

    *note – If you added a tag to line 116 of admin-install-uninstall.php then you’ll be working with line 109 of user-view-show-staff-list.php.

    I know this is a lot and I hope I didn’t forget anything. But maybe this can help you, or someone else add the fields they need to the plugin.

    Definitely +1 for this being a feature update for further releases. This plugin pretty much fits my clients needs perfectly minus this aspect. (Great UI for this, by the way)

    Plugin Author Brett Shumaker

    (@brettshumaker)

    @jhoffmcd Thanks. I’m glad you like it. I’m currently trying to figure out a way to handle being able to arbitrarily add new custom fields. I’m starting to think it might be almost too much for the average WordPress user, read “client,” to handle on their own. They’d have to specify the template tag they want to use, the label, and the HTML to replace the template tag on render.

    It could be done but I just have to make sure I carefully plan my attack.

    Thanks, again!

    Hi Brett. My client doesn’t need to create the custom fields necessarily, I just need to create the field so that it appears when they are adding new staff listings. Can this be done by editing that template? Is that what the above steps accomplish? Maybe I didn’t figure out that part πŸ™‚

    Plugin Author Brett Shumaker

    (@brettshumaker)

    Yes…my post above will allow you to add new fields.

    Thanks Brett,

    I’ll try this out and report back on how this goes.

    Hey guys – First off, Brett – AWESOME plugin. Very well put together.

    I too needed a link to a staff bio — and with a deadline hours away, I decided to dive in and modify some of your code. It’s a quick hack that fixed this for me.

    I changed the Facebook URL to Staff Member URL. And used that entry for folks to enter a staff page URL.

    In Admin-View.php I changed the Facebook URL Label to:
    <label for="_staff-member-fb">Staff Member URL: <input type="text" name="_staff_member_fb" id="_staff_member_fb" placeholder="<?php if ($_staff_member_fb == '') echo ('Staff Member\'s URL'); ?>" value="<?php if ($_staff_member_fb != '') echo $_staff_member_fb; ?>" /></label>

    Then, in the Template part of the Admin, I made the first line look like this:
    <a href="[staff-facebook]"><img class="staff-member-photo" src="[staff-photo-url]" alt="[staff-name] : [staff-position]"></a>

    Again, It’s a quick hack that I needed — and I owe all the credit to Brett.. kudos dude.

    Plugin Author Brett Shumaker

    (@brettshumaker)

    Awesome, I’m glad you got what you needed!

    Awesome plugin, very versatile – I’m using it as an address book for business contacts.

    I’ve successfully added a Company field, and it’s not too hard, 23 additional lines over 5 files – lots of copy and paste. I do have a question though, how do I make the new column, added for the field, sortable on the All Staff Members admin page? The name field is sortable, I’d like to be able to sort by company. Also, is Name the only searchable field?

    Anyway… Brett, I can send you the 5 edited files to post somewhere for others to grab and edit. All they would need to do is Find & Replace “company” and change it to whatever they want. Or I could just post them here… pretty long though.

    Cheers.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘More input fields’ is closed to new replies.