• Hi!

    I really love this plugin πŸ™‚

    At the moment I am buidling an event table for a clients website.

    I am using the Custom Field Template plugin for building a table structure to show the events with detailed informations.
    Presently I am recognizeing a strange doubled output from custom fields.

    To explain the situation:
    In every table row I am using the same fields. The output is realized by ‘the loop’ from a category of posts.

    In my template I am getting the custom field values like this:

    // Custom Field: 'Event Preis'
             if(get_post_meta($postID, 'Event Preis', true)) :
                     $ev_temp='Event Preis';
                     $ev_preis = get_post_meta($postID, $ev_temp, true);
             endif;

    The output is realized like this:
    <td class="ev-preis"><?php echo $ev_preis; ?></td>

    My custom field template contains the following related entry:
    [Event Preis]
    type = text
    blank = true
    default =
    size = 20
    label = bla

    I have recognized that sometimes the output from one post custom field comes double!
    For example when I fill in ‘1000’ in the custom field named ‘Event Preis’ for one post and I leave it blanc for another post, the output for this field is ‘1000’ also for the table row of the entry/post in which I left the field blank before.

    I cannot reproduce this behaviuor. It seem to appear sometimes and sometimes not.

    It’s a puzzle to me. Why it seems that there is a content of a custome field even when I leave the field blank?

    I try to set ‘default =’ oder ‘default =  ‘ but with no effect.

    How can I disable an output when a field is left blank.
    Or how can I define a default value which is blank or 0.

    By the way, in the description of ‘Custom Field Template’ there are many options that I do not understand.
    For example: Adds the blank option. (blank = true)
    I don’t know what it means … also many other things are not clear for me, but this is another topic.
    It would be very nice if you (Hiroaki Miyashita) can explain the different options more detailed.

    Is there anybody who can help me with the problem mentoined above?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Probably you need to unset variables in each loop.

    unset($ev_preis);

    I am sorry for the kindless help. I know I should write the usage manual of the custom filed template plugin, but I do not have enough time to do so….

    About the attribute of blank = true:
    The blank data will be created in the database if you do not input anything. If you do not set this attribute, the blank data is not produced.

    Thread Starter Endolil

    (@zabdesign)

    unset($my_luck);
    … was the missing hint! Now everything works fine! Many thanks!

    Your plugin is a great peace of software and it helps me a lot. That the documentation is not complete, is just a small shadow in a lot of light. πŸ™‚

    Are you working as a freelancer?
    I would like to hire somebody for a special plugin I would like to have. I think you could be the right man for that.

    Thread Starter Endolil

    (@zabdesign)

    I have another question now πŸ™‚

    Do I get it right:

    [My Field]
    blank = true

    will create a value for the related custom field in the database and this means for example get_post_meta($postID, ‘My Field’, true) will always return true, even when I do not input anything?

    For which purpose did you create this option?

    [My Field]
    type = text
    blank = true

    You need to specify the field type. I forgot why I added the blank attribute :), but the blank data field will be created in the wp_postmeta table even if you do not input anything.

    I am not a freelancer but managing a company for developing web systems in Japan. So I can work for you. Please e-mail me at webmaster((at))wpgogo.com (change ((at)) into @) with the detail. Thanks.

    Thread Starter Endolil

    (@zabdesign)

    Thank you!

    I checked my database and I found a lot of entries in the post_meta table. There where many entries from a custom field for which I defined as ‘blank = true’. I think I do not need this kind of attribute but maybe in a special kind of situation it can be usefull to define a custom field to be always available, even when there was no input by the user.

    By the way:
    I’ve send you an e-mail with a request.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Custom Field Template] Strange doubled output from fields (within the loop)’ is closed to new replies.