• azzimuth

    (@azzimuth)


    Hi,

    Is it possible to add buttons to the table editor? Some way similar to extensions you described in your blog. I did that before with some previous version of the plugin but then once I upgraded it, it was gone. I tried to look into the code but it seems if I do it that way I will lose my buttons with next upgrade again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    I’m not really sure what you mean with “button to the table editor”, but from what I think you mean, this is indeed possible through an extension.

    There are quite a few plugin filter hooks that you can use inside a small plugin to add content to the “Edit” page of a table. For a list please see the documentation, or better take a peak into the source code, near the relevant lines of code that create the “Edit” page.

    By using this mechanism, you won’t lose your buttons with an upgrade, as they basically are a custom plugin.

    Best wishes,
    Tobias

    Thread Starter azzimuth

    (@azzimuth)

    Hi,

    Yes, I mean the buttons you see on the table edit page. Currently there are “Insert link” and “Insert image” ones but I need to add a couple more which would insert a code to table cells.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for the clarification.

    Unfortunately, there are no plugin filter hooks in that location, so you won’t really be able to use my suggestion from above that easily here.

    So, a better solution might be to simply use some JavaScript, that you load in the admin footer. You will need JavaScript anyways, to add something to the textfields, so you can as well use it to add the button when the page is loaded.

    Regards,
    Tobias

    Thread Starter azzimuth

    (@azzimuth)

    Thanks for the tip, Tobias! Guess something like $(".wp-table-reloaded-data-manipulation tr :first").append("code for new buttons"); would work fine for this purpose.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    yes, exactly. That should allow you to add a new row to the table with all the buttons in it.

    For the actual functionality of adding something to a table cell, I suggest that you take a look into the existing code of the “Insert Link” JavaScript code (admin-script.dev.js).

    Best wishes,
    Tobias

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

The topic ‘[Plugin: WP-Table Reloaded] Adding buttons to table editor’ is closed to new replies.