I have a client that needs a slider that can either show text, or a "tweet" (using CE Tweet for getting the tweet's info). I'm using Stash, and thought this would be the best way to get there:
{exp:channel:entries
channel='slides'
dynamic='no'
}
{exp:stash:set_list
name='home_slides'
parse_tags='yes'
parse_depth='2'
}
{if slide_type == 'tweet'}
{slide_tweet type='show'}
{stash:list_text}{text}{/stash:list_text}
{stash:list_attribution}{user_name}, <a href="https://twitter.com/{user_screen_name}" target="_blank">{user_screen_name}</a>{/stash:list_attribution}
{stash:list_cta}<span class="ui-retweet"></span> Retweet{/stash:list_cta}
{stash:list_link}https://twitter.com/intent/retweet?tweet_id={id_str}{/stash:list_link}
{/slide_tweet}
{if:else}
{stash:list_text}{slide_text}{/stash:list_text}
{stash:list_attribution}{slide_source}{/stash:list_attribution}
{stash:list_cta}{slide_call_to_action}{/stash:list_cta}
{stash:list_link}{slide_link}{/stash:list_link}
{/if}
{/exp:stash:set_list}
{/exp:channel:entries}
This is where I'm outputting the list (simplified slightly):
{exp:channel:entries
channel='pages'
limit='1'
require_entry='yes'
}
{exp:stash:set parse_tags='yes'}
{stash:page_title}{title}{/stash:page_title}
{stash:page_content}
<section class="slider">
<ul data-orbit data-options="bullets: false; ">
{exp:stash:get_list name='home_slides' prefix='list'}
<!-- {list:count} -->
<li>
<div class="row">
<div class="large-12 columns">
<h2><span class="ui-quote"><span class="ui-quote-open"></span></span>
{list_text}<br>
<small class="attribution">{list_attribution}</small>
</h2>
<p><a href="{list_link}" class="btn">{list_cta}</a></p>
</div>
</div>
</li>
{/exp:stash:get_list}
</ul>
</section>
{/stash:page_content}
{/exp:stash:set}
{/exp:channel:entries}
Now after my actual entry gets outputted, another "slide" gets put into my template, but all the stash-variables in that list-item are empty. Any idea as to where this emtpy item might come from?
Thanks!
- Steven