Support » Plugin: Gravity Forms Entries in Excel » Admin field labels

  • Resolved toll02

    (@toll02)


    Am very happy with the plugin – it will make my Monday morning ‘admin’ days a lot easier …

    I saw a thread about displaying ‘admin field labels’ with ‘bridieamelia’ and have used the php code you provided to display admin fields which is very helpful.

    1. Is it possible for this admin label to be used in the export ONLY if no other label is available (rather than either /or). I have a form with 35+ fields, 10 of which have just an admin field label.
    2. Fields that only have an admin label are very difficult to work with on the plugin settings page as they appear ‘blank’ – it’s not too bad the first time you look at the enabled / disabled fields as you can ‘count’ your way through to get at the right fields but once you start enabling / disabling then the original order is lost (when a ‘blank’ field is re-enabled it seems to go automatically to the bottom of the ‘Enable & sort’ column) and identification becomes quite tricky and confusing. Is there any chance of displaying an admin field label in the plugin dashboard (maybe in another colour) if there is no other label available?

    Many thanks

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Doeke Norg

    (@doekenorg)

    Hi @toll02,

    1. yes this is possible. The following code should help you out (I changed the one you found a bit):

    $transformer = new GFExcel\Transformer\Transformer();
    add_filter('gfexcel_field_label', function ($value, GF_Field $field) use ($transformer) {
        // If we have a regular value, use that.
        if (!empty($value)) {
            return $value;
        }
    
        $gfield = $transformer->transform($field);
        if (!$gfield instanceof GFExcel\Field\SeparableField) {
            // This is a bit more GF friendly than asking for <code>adminLabel</code>.
            $field->set_context_property('use_admin_label', true);
            return $field->get_field_label(false, null);
        }
    
        // Fall back to empty value.
        return $value;
    }, 10, 2);

    2. Not yet unfortunately. Apparently I’ve not implemented this very nice (like the code snippet above). So I’ve opened up an issue to fix this in the next release. That doesn’t help you out right now, but this will be fixed. Thank you for pointing it out!

    I’ll keep you updated on the progress.

    Code works really well. Thank you very much for your quick and helpful response.

    Plugin Author Doeke Norg

    (@doekenorg)

    Hi @toll02,

    I’ve just released 1.7.1. If you update your labels should now be the same in the sortable list. Kind regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Admin field labels’ is closed to new replies.