
Best Answer eric, 24 June 2014 - 02:26 PM
My apologies for the delayed response. It took me longer than I thought to work through the solution - mainly due to some misconfiguration in my local dev environment.
Switching your solution to albums will not be difficult. Here's a proof of concept that I just built: http://youtu.be/ogcxVMF0ygc. You should be able to extrapolate from this demo
to fit your needs.
The "parent" page (the one hosting the Cats and Dogs buttons) is a regular WordPress page with the following content:
<div id="result">[tubepress]</div> <button id="cats-button">Cats</button> <button id="dogs-button">Dogs</button> <script type="text/javascript"> jQuery(function () { jQuery('button').click(function () { var prefix = jQuery(this).attr('id').replace('-button', ''); jQuery('#result').load('/supplier-page/?album=' + prefix); }); }); </script>
There are three important pieces here:
- A <div> with id="result" that contains a TubePress gallery (though this could be empty if you'd like).
- Two buttons, each corresponding to a set of videos that we'd like to show.
- Some jQuery which populates the result div via an Ajax call to /supplier-page/. We tack on an "album" parameter to the Ajax URL.
/supplier-page/ is another regular WordPress page, but I've used a custom template for it. i.e. the file is called page-13.php and sits inside my theme directory. The contents of
page-13.php is:
<?php include WP_PLUGIN_DIR . '/tubepress/src/main/php/classes/TubePressPro.php'; switch ($_GET['album']) { case 'dogs': $tagValue = 'dogs'; break; default: $tagValue = 'cats'; break; } echo TubePressPro::getHtmlForShortcode('[tubepress mode="tag" tagValue="' . $tagValue . '"]');
As you can see, we read the album parameter and spit back the appropriate TubePress-built thumbnails. In your case, instead of using tag and tagValue, you'll want to use something like
echo TubePressPro::getHtmlForShortcode('[tubepress mode="vimeoAlbum" vimeoAlbumValue="' . $albumValue . '"]')
Make sure to sanitize anything retrieved from $_GET, of course. Does that make sense? Let me know if you need any assistance in implementing, or if anything from this proof of concept is not clear. Hope this helps?
Go to the full post