• Does someone have an example of how this is used? I understand how a custom field is used in WP, but for the templates, what is the key?

    For example, if I have a template like:

    Template Title = “My_Book”

    [Author]
    type = textfield
    size = 50

    [Pages]
    type = textfield
    size = 10

    [Description]
    type = textarea
    rows = 4
    cols = 40
    tinyMCE = true

    How would I display the information in a post?

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter benrice

    (@benrice)

    I have that figured out. Now does anyone know how to use the plugin to add multiple custom fields with the same key? I should be able to, for example, add multiple “Images” and then use get_post_meta($post_>ID,”Image”,false) to return an array of the custom fields with that key. I don’t know how to use the template though to add more than one custom field with that key.

    Multiple fields with the same key were supported in the version 0.4. You can set something like this.

    [Plan]
    type = textfield
    size = 35

    [Plan]
    type = textfield
    size = 35
    hideKey = true

    However, the case you do not know how many fields you want to use is not supported at this time. The number of keys is fixed according to your template.

    Thanks.

    Hiroaki,

    I am looking for a different method of “multiple fields with the same key”.

    I want a checkbox list where the author could choose more than 1.

    For example,

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

    If the author checks Apples and Oranges, then it would be 2 fields assigned to the key Favorite Fruits.

    If the author checks only Apples, that is ok.

    If the author checks Apples and Oranges and Banana, that is ok.

    Can this be done? Thank you very much.

    ————

    EDIT:

    He answered in another thread. He said use this:

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

    [Favorite Fruit]
    type = checkbox
    value = apples
    checked = true

    [Favorite Fruit]
    type = checkbox
    value = oranges
    hideKey = true

    [Favorite Fruit]
    type = checkbox
    value = banana
    hideKey = true

    I know the way which you are talking is better than the current way. I thought the code may be a little bit complicated, so I quit it at this point. I am sorry for my laziness. I will consider adding the easier way for checkboxes in the future release. Thanks.

    every came across this one? https://www.lukew.com/ff/entry.asp?727 that′s something that really rocks and it′s way better than any sort of multiple checkboxes. hope you add that in the future, mr. hiroaki!

    The way like following code is already supported.

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

    I added the sort option like sort = asc or sort = desc, but I will consider the free sort option. Thanks.

    i′m sorry. i have to correct myself. i didn′t mean checkboxes. instead i meant drop-downs. multiple selection drop-downs to be specific. there have been some js-sollutions for multiple checkbox-selections inside drop-downs with large/extensive content. the link i mentioned above is a way better solution, because it shows and keeps the selections. when it′s scrolled outside the viewport, normal drop-downs make real problems and are the opposite of user friendly. you simply can′t overlook something, when it′s displayed separatly.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Custom Field Template] Usage?’ is closed to new replies.