• Hi

    I try to do this

    add_filter(‘gfexcel_renderer_hide_row’, function ($hide, $row) {
    foreach ($row as $column) {
    echo $column;
    if ($column->getFieldId() === 9 && $column->getValue() !== $posttitle ) {
    return true; // hide rows with an empty field 1
    }
    }
    return $hide; // don’t forget me!
    }, 10, 2);

    It work great with

    $posttitle = “some title”

    but i have no idea how to get $posttitle form the page where my download button is.

    Any leads?

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter David Corradini

    (@davouid)

    Hi

    I realise that it is more tricky than that.
    When is the file generated?

    My goal is to have one form but the excel shows different row when the download button is in different page…

    Plugin Author Doeke Norg

    (@doekenorg)

    Unfortunately what you’re trying to achieve just isn’t possible. At least, not by normal hooks and stuff. The download link is a page of it’s own, so it doesn’t matter where the link is, the browser just opens that page, and then realizes it’s a download, so it forces it as a file. There is no reference to the current page whatsoever.

    What you could try, is to read the $_SERVER['HTTP_REFERER'] and see if it contains the page you came from. Using that url you might be able to figure out what page contained the download button. Otherwise there is just no way; I’m sorry 🙂

    Just to be clear: Hiding the row doesn’t excluded it from the export. The row is hidden by default, but it can be made visible within excel. So if that is not your goal, you should use gfexcel_output_rows to exclude it from the data-set.

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

The topic ‘Hide row with “post title”’ is closed to new replies.