Support

Account

Home Forums Add-ons Flexible Content Field Flexible Content Displaying Zero's & Limited Fields

Helping

Flexible Content Displaying Zero's & Limited Fields

  • Hello, love this plugin! I purchased the “Flexible Content” Add-On and I’ve got 2 problems that I’m hoping someone out there can help me solve.

    1) Display Zero’s
    My clients site needs to display zero’s if entered into the field, but if we enter “0” it doesn’t display on the front end. I know it’s because of the get_sub_field if statement that it’s not showing, and I also know that I can get it to work if I add !== false to the code, however, that makes it so empty items show up when there is no content. I need it to work like this…if the field is empty, don’t show it, if the field has content (any content including zero’s) show it. That’s it. Here’s the basic function I”m using:

    // Sand Equivalent
    if( get_row_layout() == 'sand_equivalent' ):
    if( get_sub_field('sand_equivalent-data') !== false):
    echo '<tr class="row row-section">';
    echo '<td class="column-1">D2419</td>';
    echo '<td class="column-2">T176</td>';
    echo '<td class="column-3"><strong>Sand Equivalent</strong></td>';
    echo '<td class="column-4">Sand Equivalent</td>';
    echo '<td class="column-5">' . get_sub_field('sand_equivalent-data') . ' </td>';
    echo '</tr>';
    endif;
    endif;
    

    2) Limited Fields with Flexible Content
    In my flexible content field, I have about 15 layout rows each having about 3-4 sub-fields. I need to have 19 layout rows, however the flexible fields won’t allow me to add more. I’ve read on these forums these helpful posts:

    I’ve tried the php.ini and the .htaccess solutions, as well as bumping the memory_limit and non of those fixed the issue. So my questions are:

    1. Are there any other solutions to get just a few more fields?
    2. Is this a limit of the Flexible Content Add-On? or would this same thing happen if I just used regular fields?
    3. It sounds like ACF5 will probably fix this, how soon until this is released?

    Thanks for your time and help today!

  • I am noticing a similar issue (#2) as well for limiting fields. Haven’t narrowed down the cause yet, but I have 9 layouts, each with 1-4 sub-fields. When I add more than 9, the new layouts do not get saved in the db, and a few PHP Notices are thrown (debug.log):

    PHP Notice: Undefined index: rules in …
    PHP Notice: Undefined index: allorany in …

    Additionally, the custom button name I use (“Add Page Section”) changes back to “Add Row”

    Not sure where to look to fix this bug.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.