WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Custom Field Template] default type does not work (5 posts)

  1. alienfactory
    Member
    Posted 4 years ago #

    Select default does not seem to work for any of the values i have set and if i save the post without selecting any thing i get the following on my site
    mf_page_type: Post

    They will load if i hit the initialize button

    Is there something i missed in the config

    Thanks
    Terry

    [Due Date]
    type = text
    size = 35
    date = true
    default = 4/4/45

    [Responsible Patry]
    type = checkbox
    value = Meggan # Cathy # Inga # Sue # Kim # Terry
    default = Meggan # Cathy # Inga # Sue # Kim # Terry

    [Status Level]
    type = radio
    value = High # Medium # Low
    default = Low

    [File Upload]
    type = file

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

  2. Hiroaki Miyashita
    Member
    Posted 4 years ago #

    You need to hit the Initialize button on the right upper corner in order to load default values.

  3. alienfactory
    Member
    Posted 4 years ago #

    Can you tell me how I could have default items without having to click on the initialize button

    thank Terry

    by the Way love this plugin

  4. Decio
    Member
    Posted 4 years ago #

    I thought this was a bug, as the default option works in the first template (template #0), but not on the next ones.

    But I also realized the first template comes already loaded (and with the default working).

    Maybe you could make the default load automatically with the template?

    I also love your work.

  5. DannyB
    Member
    Posted 3 years ago #

    This is one area of CFT that is tricky because its an extra step to train clients to hit the Initialize button the first time to get default values but not after values are set.

    I prefer to hide the Initialize button in the Global Options if possible.

    To get around setting up default variables, I just check in the template code, when getting the value initially, if the variable has been set (is null) and if not assign it the default.

    For example,here 'show' would be the default value:

    $showsidebar = get_post_meta($post->ID, 'sidebar', $single = true);
        if ($showsidebar == "" ) {$showsidebar = "show";}

    I'll also chime in that I love this plugin and the way you support it, Hiroaki

Topic Closed

This topic has been closed to new replies.

About this Topic