WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Custom Field Template] Pretty Good (29 posts)

  1. thecoup
    Member
    Posted 5 years ago #

    This seems to work pretty well. I really wish this was a core feature of WP. Adding simple forms for custom field input really expands the use of WP as a CMS.

    For this plugin, I'd like to see a full list of options in the documentation. Also, I'd like to turn off Add Media buttons when not using tinyMCE.

    http://wordpress.org/extend/plugins/custom-field-template/

  2. Dgold
    Member
    Posted 5 years ago #

    Thanks for the idea. I have been using rc: Custom Fields GUI, for years. This plugin says it is like that one, but reloaded.

    I only wish it would offer the option of a Multiple Select drop-down, or Multiple Select Checkboxes.

    So you could ask the question / key: Name All Your Favorite Fruit (check all that apply):
    Apples
    Oranges
    Kiwi
    Grapes

    Currently I think there is only the option for "Select 1" (aka radio button).

  3. Hiroaki Miyashita
    Member
    Posted 5 years ago #

    Thank you for using the custom field template plugin. I added some functionalities in the version 0.4.

    I added the mediaButton option in the textarea. The default is set as false. If you want to use media buttons, add 'mediaButton = true'.

    Multiple fields with the same key are supported. Something like this.

    [Favorite Animal]
    type = checkbox
    value = dog
    checked = true

    [Favorite Animal]
    type = checkbox
    value = cat
    hideKey = true

    [Favorite Animal]
    type = checkbox
    value = monkey
    hideKey = true

    'hideKey' is the option for hiding the field name.

    Thanks.

  4. Dgold
    Member
    Posted 5 years ago #

    Hiroaki, I just saw this post. I already wrote a reply in the other thread about this plugin.

    I see your method for making multiple fields with the same value.

    It looks OK, I will try it.

    I was picturing something slightly different, but it looks like your method could work instead.

    I thought it would be something like this,

    [Favorite Fruits - Check All That Apply]
    type = multiple-checkbox
    value = Apples # Oranges # Banana

    I will try your other method instead.

  5. Hiroaki Miyashita
    Member
    Posted 5 years ago #

    I added the way you mentioned in the version 0.4.4.
    You can set like this.

    [Favorite Fruits]
    type = checkbox
    value = apple # orange # banana # grape
    default = orange # grape

    I hope this will work well in your situation.

  6. Dgold
    Member
    Posted 5 years ago #

    Thanks! I saw this post. I'm going to try the new version soon (within the next week when I get time to change my plugins)

  7. Dario Ferrer
    Member
    Posted 5 years ago #

    Wonderful plugin. You saved my life today Hiroaki! Thanks.

    A little option to clear radio buttons would be nice ;). Sometimes an user can choose a wrong option. Yes, its possible to create an empty radio button, but it looks a little ugly staying there alone |D.

  8. Hiroaki Miyashita
    Member
    Posted 5 years ago #

    I added the option clearButton = true in radio buttons in the version 0.5.0. So you can create an empty radio button, even though the default is checked. I hope it will work well. Thanks.

  9. Dgold
    Member
    Posted 5 years ago #

    ANOTHER REQUEST about adding labels or instructions

    Hiroaki, I have another feature request for Custom Fields Template.

    Can you add the ability to write more "labels" or "instructions" for my Authors to see, near (above, below, beside) each custom field in the Write Post area?

    Currently, and with the old predecessor plugin rc:customfields, I have to use another "fake" custom field just to write the instructions. Because I don't want the instructions to be written and displayed in the KEY.

    Example, I use this work-around. I want the Authors to understand what the "Map" field means. You have to put a URL in the map field, for it to work on my site. So I have a second custom field with the key "NOTE Map ABOVE is a hyperlink linking to Google Earth XML map". The only reason for this 2nd field, is just to display the instructions.

    [Map]
    type = textarea
    rows = 3
    cols = 40

    [NOTE Map ABOVE is a hyperlink enclosed a href tags linking to Google Earth XML map]
    type = textarea
    rows = 1
    cols = 1

    I was thinking, maybe you can add a feature called "Label".

    Maybe it would work like this:

    [Map]
    type = textarea
    rows = 3
    cols = 40
    label = "NOTE Map ABOVE is a hyperlink enclosed a href tags linking to Google Earth XML map"

    Thank you again for improving this great plugin Hiroaki Miyashita.

  10. Dgold
    Member
    Posted 5 years ago #

    ANOTHER REQUEST about the Display of Keys under Write Post

    Under the Write Post page where you can see the Custom Field Templates -- can you make the "Key" appear ABOVE the field for the value, instead of on the left?

    OR, can you make each "Key" name to be Right-Aligned, instead of Centered?

    Currently it does not line up nicely. The Key names are far to the left, and the Value fields are pushed far to the right. This is because some of my Key names are short words, and some of them are "Lots of long words for the key name" thus pushing all the field boxes off to the right.

  11. Dgold
    Member
    Posted 5 years ago #

    MINOR REQUEST FOR REMOVING TEMPLATES DROP DOWN

    Can you make the "Template" drop-down, optional? I'm only going to use one Custom Fields Template. It will just have the 7 or 8 custom fields that I want my Authors to always use.

    I don't want them to see the drop-down menu for choosing other templates. It's just a bit confusing, it looks like it IS another custom field that they need to select from.

    THANKS AGAIN
    Is your site wordpressgogo? If that is you, Hiroaki, I will send a small donation as Thanks for this plugin. I know I've asked a lot of suggestions, and you did the 1st thing with Multiple Checkboxes. Very nice. It is useful, and I am happy someone is developing it after I waited 1 year with no changes in the predecessor plugin rc:customfields.

  12. Hiroaki Miyashita
    Member
    Posted 5 years ago #

    Hi Dgold,
    Thank you for your requests every time. I released the version 0.5.2. I added the label option in every field type, so you can use something like label = NOTE Map ABOVE is a hyperlink enclosed a href tags linking to Google Earth XML map. The custom field template select box is displayed only if it has multiple templates. So if only one template is set, the drop-down box is not shown. I adopted the css design of custom field templates. You can set css in the setting page. The following is an example of which keys are above fields.

    #cft dl { clear:both; margin:0; padding:0; width:100%; }
    #cft dt { font-weight:bold; margin:0; text-align:left; }
    #cft dt .hideKey { display:none; }
    #cft dd { margin:0; text-align:left; }
    #cft dd p.label { font-weight:bold; margin:0; }

    Yes, my site is http://wordpressgogo.com/ . I really appreciate your support donation. Thanks.

  13. Dgold
    Member
    Posted 5 years ago #

    Awesome! It keeps getting better! And so I sent a donation on your site, and again, thanks for updating this.

    I'm trying it with this CSS right now. If anyone else can make it better, please post.

    #cft dl { clear:both; margin:0; padding:0; width:100%; }
    #cft dt { font-weight:bold; margin-top:4px; text-align:left; font-size: 150%}
    #cft dt .hideKey { display:none; }
    #cft dd { margin-left:8px; text-align:left; }
    #cft dd p.label { font-weight:bold; margin-top: 8px; }

  14. CowboyFrank
    Member
    Posted 5 years ago #

    Is it possible in my templates to call only certain of the custom fields?

    For example, on page template A, I'd like to show a "teaser" thumbnail picture next to an article's headline. However, on page template B, I'd like to show a big picture above the post's headline. So how could I do this?

    Forgive me if this is something obvious that I missed! :) Thanks!

  15. Dgold
    Member
    Posted 5 years ago #

    @CowboyFrank,

    Study this
    http://codex.wordpress.org/Using_Custom_Fields#Getting_Custom_Fields

    You get get the code there for showing just 1 of the custom fields at a time.

    Or you can use this plugin,
    http://wordpress.org/extend/plugins/get-custom-field-values/

    Sounds like you already knew about php the_meta which is used for showing Allllll your custom fields (key-value pairs).
    http://codex.wordpress.org/Template_Tags/the_meta

    Note the code I requested in this thread, MichaelH says how to EXCLUDE certain custom fields from the_meta so you can use the_meta to show all your custom fields EXCEPT a few certain ones.
    http://wordpress.org/support/topic/217076?replies=5

    enjoy

  16. CowboyFrank
    Member
    Posted 5 years ago #

    Awesome! Thanks so much! The particular piece of script I ended up using was:

    <?php $mykey_values = get_post_custom_values('Thumbnail');
      foreach ( $mykey_values as $key => $value ) { echo "$value"; }?>

    ...where 'Thumbnail' was the name of the custom field.

  17. verowhite
    Member
    Posted 5 years ago #

    This plugin is just amazing. Thanks, Hiroaki. I will be sending a donation your way for sure.

    I seem to be having some kind of problem with the CSS formatting. All the fields look the same when I see the output in a page. What could be wrong? When I take a look at the code from the output page, everything seems ok, but I can't the CSS bit from the templates options anywhere, just the code calling the cft class.

    Anyone?

  18. Hiroaki Miyashita
    Member
    Posted 5 years ago #

    Hi verowhite,
    You mean the css of output page which is called by the [cft] shortcode? CSS of the setting page of custom field template is for the edit post/page. It is not loaded on the output page. Well, I may add the css setting or file in the future, but currently please write down the css directly to style.css of your theme. I appreciate your support:) Thank you.

  19. verowhite
    Member
    Posted 5 years ago #

    Oh! Ok, I understand now. So i guess I would have to write my own code to customize that by defining the ctf class in my style.css file, right?

    Thanks again, Hiroaki.

  20. Hiroaki Miyashita
    Member
    Posted 5 years ago #

    Yes, that's right. The dl tag has cft class. Add your own css in your style.css based on that class.

  21. Dario Ferrer
    Member
    Posted 5 years ago #

    Hiroaki, I was made a spanish translation. Where I can send it?

  22. Hiroaki Miyashita
    Member
    Posted 5 years ago #

    Great! Send me the file to webmaster[at]wordpressgogo.com. I will include it in the next release. If you have your site, I will link to it from the plugin page. So, let me know. Thank you!!

  23. CowboyFrank
    Member
    Posted 5 years ago #

    Uh Oh! I'm using the code I posted above:

    <?php $mykey_values = get_post_custom_values('Thumbnail');
      foreach ( $mykey_values as $key => $value ) { echo "$value"; }?>

    ...Which works fine where there's a value assigned to the corresponding custom field (Thumbnail, in this example). However, though the codex documentation (http://codex.wordpress.org/Function_Reference/get_post_custom_values) says that a custom field left blank will return nothing, I get this error for any post that does not have content in the custom field:
    Warning: Invalid argument supplied for foreach() in path/single.php on line X
    (Actual path truncated and line number removed.) Do I need some kind of "if" piece of code, to ensure that a blank custom field will return nothing? I'm a total noob with PHP, so I'd need this spelled out for me.

    I can give practical examples if necessary. Thanks!

  24. Dgold
    Member
    Posted 5 years ago #

    @ CowboyFrank, try something like this

    It says IF your custom field key's value == '' BLANK, then (do nothing), or you could put something here like printing "There's not a thumbnail for this post because I forgot to put one"

    ELSE, IF it isn't blank, then echo the value (prints your thumbnail).

    <?php
    $yourthumbnailkey_values = get_post_meta($post->ID, 'Thumbnail', true);
    if ($yourthumbnailkey_values == '')
    { ?>
    
    <?php } else { ?>
    
    <?php echo $yourthumbnailkey_values; ?>
    
    <?php } ?>

    Hope that works for ya! I found it very useful.

  25. CowboyFrank
    Member
    Posted 5 years ago #

    WOW! Thanks so much! Works perfectly.

  26. Dgold
    Member
    Posted 5 years ago #

    You're welcome. I was very happy too when someone showed me that type of code on here earlier.

  27. wordpredia
    Member
    Posted 5 years ago #

    Great!
    Is it possible when a user mark the right answer add a point to the user profile/account?

  28. C0BALT
    Member
    Posted 5 years ago #

    This is a very good plugin.
    I'm having a slightly different problem around having "blank" custom fields.

    I would like to force appending a single space into a text area to prevent the sql-data entry from disappearing.

    I have 12 posts (of a specific category) which are cleared (not deleted) via cron at midnight every day. These posts are then editable by editors through-out the day with up to the minute information via the custom-fields plugin.

  29. Hiroaki Miyashita
    Member
    Posted 5 years ago #

    Hi C0BALT,
    I released the version 0.8. I added the blank option. If you set blank = true attribute, the value will be saved if it is blank.
    Please try it out. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic