• Resolved nessumsar

    (@nessumsar)


    Could you give an example on how to use this gfexcel_renderer_worksheet_title hook? Pretty sure it’s a filter hook?

    I’ll try to give you some context for you.
    We’ve made a “Worksheet.php” with an inner class called Worksheet that takes a label and field_IDs in the constructor. Then we create all the sheets like this in our kotp file.

    $red_tide_sheet = new Worksheet(“Red Tide”, array(2, 6, 16, 15));

    I’m not sure but I belive I should use the hook in kotp somehow.

    Thanks for awesome support. I’ll help you translate your plugin to swedish (when I’ve got time) as a thanks for your assistance.

    (Apparently I couldn’t reply in our email-conversation)

    //Lukas

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

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

    (@doekenorg)

    HI Lukas,

    Sure. Here you go https://gist.github.com/doekenorg/6144f6096829a3717d66fd6fdd42a702.

    You can combine it with your own code to make sure you get a different title when called 3 times in a row ??

    Hope this helps.

    Thread Starter nessumsar

    (@nessumsar)

    Thanks!

    I’ve tried to modify it to get a different title every time I call the function but I do not succeed, would you mind giving me some help?

    Also when I try to use this hook, all my sheets turn out to be exactly the same. Could be that I have messed up my code, or is it possible that this hook effects that?

    Thread Starter nessumsar

    (@nessumsar)

    Also when I try to use this hook, all my sheets turn out to be exactly the same. Could be that I have messed up my code, or is it possible that this hook effects that?

    Forget about this part, it was me who messed up my code a bit. Still haven’t solved getting different titles on the sheets.

    Currently I have 25 sheets and the last sheet is supposed to be called “?vrig”. All sheets get this name right now. If I remove the sheet called “?vrig”, all the sheets is named “Gloria” which is the last one when removing “?vrig”. So it seems like it will take the last title from the last sheet and put it on all sheets.

    Plugin Author Doeke Norg

    (@doekenorg)

    @nessumsar please share your code so I can take a look at it.

    Thread Starter nessumsar

    (@nessumsar)

    https://github.com/Nessumsar/gfexcel_for_doeke

    I added a few extra files that might or not effect the outcome here. Check the kotp.php file, I think the problems is only in that file and worksheet.php.

    I’ve tried a few different things but I just cleaned the code to be in the “original state” in order to skip unnecessary code.

    Thanks a lot.

    Plugin Author Doeke Norg

    (@doekenorg)

    @nessumsar I’ll take a look at it as soon as I have time. But today is my wedding anniversary so I can’t make any promises. But at first glance: You are not checking the form ID anywhere for the sheet name. So yes, every sheet will have the same name now ?? You need to use the $form variable like I mentioned in the code.

    Thread Starter nessumsar

    (@nessumsar)

    Alright, take your time! No worries.
    Thanks for the hint. I’ll update here if I manage to solve it.

    Have an awesome anniversary! ??

    Thread Starter nessumsar

    (@nessumsar)

    Any ideas?

    Got no clue how to use $form in order to give the sheets unique names…

    Plugin Author Doeke Norg

    (@doekenorg)

    You can use the same logic you have for should_disable_field(). Retrieve the current sheet the same way, but then retrieve the title. You need to remove the hook from the worksheet class. Because that is now causing you the problems.

    I’m sorry I can’t do anymore.

    Thread Starter nessumsar

    (@nessumsar)

    You’re an angel mate!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Renaming sheers’ is closed to new replies.