• Resolved brit77

    (@brit77)


    First, thanks for making this widget available! I’m getting ready to install it on several of the sites I manage.

    Can you provide any guidance on how I may edit this plugin to display a different modal for the upcoming Battle for the Net campaign? I’d like to display the modal used here: https://widget.battleforthenet.com/demos/modal.html?theme=slow “Sorry, we’re stuck in the slow lane.”

    -Sarah 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter brit77

    (@brit77)

    I experimented a bit with the code here: https://github.com/fightforthefuture/battleforthenet-widget and found something that seems to work. In the fftf-alerts.php file, I added theme: “slow” to line 85:

    'extra' => 'var _bftn_options = { iframe_base_path: "https://widget.battleforthenet.com/iframe", theme: "slow" }',

    Are there any issues with doing it this way? (other than losing the changes when the plugin updates!)

    Thanks again,
    S.

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    There shouldn’t be anything wrong with that edit (except obviously being overwritten). But … a better way would be to make an MU plugin for yourself with this:

    
    $battleslow = 'var _bftn_options = { theme: "slow" }'
    wp_add_inline_script( 'battleforthenet', $battleslow, 'before' );
    

    I’m fairly certain that’ll work for you. I’m not 100% on all my Javascript yet, so I think you can declare the options twice… Hope so.

    FWIW, I decided to go with decisions, not options, when I made it and not allow for ALL the different options each event had. That’s a lot of management and a lot more though than most people want to put in to this to use it. The only reason the extra value is there at all is they have a certificate error :/

    Thread Starter brit77

    (@brit77)

    Thanks for the insight, Mike.

    Since the campaign is in a couple of days, I’ll stick with the simple one line addition to the plugin file (assuming there won’t be a critical update in that time!).

    • This reply was modified 8 years, 11 months ago by brit77.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Modal options’ is closed to new replies.