WordPress.org

Ready to get started?Download WordPress

Forums

8tracks Radio: Official Shortcode Plugin
One small gripe (5 posts)

5 stars
  1. Erik Ford
    Member
    Posted 1 year ago #

    I am totally digging this plugin and am using it on my little old blog. The only, very small gripe I have is that there is no real way of modifying the output without hacking the files. I needed to do so to make the player responsive, as seen on this post. Have you thought about allowing the shortcode output to be filtered?

  2. songsthatsaved
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, Erik! Thanks for the kind words about the plugin, and the question. Output filtering hadn't actually occurred to me, when I was writing the plugin, but anything's possible. Since I can't see your post just now (you're tinkering), what exactly did you have in mind?

  3. Erik Ford
    Member
    Posted 1 year ago #

    Yes, I am tinkering with the theme right now. I should be finished by the end of the week.

    In the meantime, this is how I edited your $output string:

    $output = '<div class="fluid_8t" style="position:relative;padding:0;width:100%;padding-top:100%;margin-bottom:1.563em;">';
    $output .= '<iframe class="nd-eight" src="http://8tracks.com/mixes/' . intval($xml->mix->id) . '/player_v3_universal/' . $playops .'" ';
    $output .= 'width="' .intval( $width ) . '" height="' . intval( $height ) . '" style="border: 0px none;width:100%;height:100%;position:absolute;left:0;top:0;"></iframe>';
    $output .= '</div>';

    As you can see, though not wholly optimal, I am using inline styles to make the image responsive. I don’t know if you want to include that in your code or, as I was suggesting, allow themes to filter the $output with something like this:

    // allow plugins to filter the output
    $output = apply_filters( 'eighttracks_shortcode', '', $atts );
    if ( $output != '' ) return $output;

    Just a thought. Still love the plugin though. It has actually gotten me excited about my 8tracks account again.

  4. songsthatsaved
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, Erik!

    Thanks, again, for the kind words. It's great that you're feeling excited about your 8tracks account, again! :)

    I can definitely see your point about wanting to allow themes to filter the output. I'm actually working on a few different features for the forthcoming 1.0 release, and I'll see if I can't get this in there, too. :)

  5. songsthatsaved
    Member
    Plugin Author

    Posted 1 year ago #

    So, I think I've got the support for filtering working in the most recent build of the plugin. Basically, I've given the iframe elements a class of "tracks-iframe," and wrapped those in a div with a class of "tracks-div." I tested with some custom css, and they do indeed seem to be responding.

    In any case, that's a long way of saying that you might want to wait, but you're very welcome to check things out by grabbing the development build of the plugin. It's stable, and backwards compatible (save for the widgets), so you shouldn't run into too much trouble.

    Either way, the plugin's getting closer to 1.0. If you do check it out, I'd love to know how it works for you. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.