0
votes

I'm currently using a custom Slider for my photoset posts on tumblr (http://woothemes.com/flexslider)

I wanted to know if its possible to make my theme display the default tumblr photoset (instead of the custom slider) when a post is tagged as #set. I wouldn't mind if I also had to tag the photoset posts that I want to display using the custom Slider to make it work.

It seems pretty complicated for me but maybe there's a solution using javascript.

Thank you


Update: I spent some time on it and I managed to solve this without any javascript (it was simpler than I thought it would be)

.post .photo-slideshow {display: none;}

.post.set .flexslider {display: none;}

.post.set .photo-slideshow {display: block!important;}

I basically put together in the {block:Photoset}...{/block:Photoset} tag. both the flexslider code and Pixel Union's custom photoset code and used the css above to hide the slider when the photoset is tagged as #set.

I had to use the custom photoset script because it wouldn't work with tumblr's default photoset iframe.

1

1 Answers

0
votes

Displaying both and hiding one, seems a little hacky. Why not use the tag / correct selector to create either a slider or photoset?

HTML

/* Default - slider */
<div class="post">
  <ul class="photoset">...</ul>
</div>

/* Tagged `set` - photoset */
<div class="post set">
  <ul class="photoset">...</ul>
</div>

jQuery

// Default, so create a slider.
$('.post:not(.set)').find('.photoset').pxuPhotoset({ ... });

// Tagged `set`, so create a photoset.
$('.post.set').find('.photoset').pxuPhotoset({ ... });