2

Hrm, me again. Looks like I am having problems with Stash and Parse Order, after all, but on a different variable.

Here's my variable:

<p class="heading"><b>Our Featured Members</b></p>
<div class="sidebar-block featured-members gray-box">
    <div class="member-holder">
        {exp:search_fields 
            search:member_profile_image="not IS_EMPTY" 
            operator="AND" 
            channel="users" 
            parse="inward"
        }
            {exp:channel:entries channel="users" entry_id="{search_results}" limit="9" sort="asc" orderby="random" dynamic="no" status="not closed"}
                <a href="{entry_id_path='meet-gay-people/profile'}">{exp:ce_img:single src="{member_profile_image}" width="302" crop="yes" height="302" allow_scale_larger="yes" attributes='alt="{screen_name}"'}</a>
            {/exp:channel:entries}
        {/exp:search_fields}
    </div>
    <a class="button center" href="{path='meet-gay-people'}">Connect with other travelers today!</a>
</div>

And here’s my template partial:

{exp:switchee variable="{segment_2}" parse="inward"}
    {case default="yes"}
        {embed="layouts/.default"}
        {exp:channel:entries
            channel="blogs"
            disable="category_fields|member_data|pagination|trackbacks"
            require_entry="yes"
        }
            {if no_results}{redirect="404"}{/if}
            {exp:stash:set name='pagetitle'}{title} — Gay Blog — The New GayTravel.com!{/exp:stash:set}
            {exp:stash:set name='bodyclass'}blog detail{/exp:stash:set}

            {exp:stash:set name='maincontent' parse_tags="yes" parse_depth="4" output="yes" parse="inward"}
                <div class="main-banner">
                    <figure>
                        <figcaption>
                            <h1 class="header">{title}</h1>
                            <p>Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>
                        </figcaption>
                        <img src="{blog_main_image}" alt="{title} Image" />
                    </figure>
                    {lv_ad_tob_banner_square}
                </div>
                <div id="content">
                    <main role="main">
                        <section class="content-block interior-page">
                            <div class="byline">
                                <h4>POSTED BY <a href="#">{author}</a> ON {entry_date format="%M %d, %Y"}</h4>
                            </div>
                            <div class="addthis">
                                <!-- AddThis Button BEGIN -->
                                <div class="addthis_toolbox addthis_default_style addthis_16x16_style">
                                <a class="addthis_button_facebook"></a>
                                <a class="addthis_button_twitter"></a>
                                <a class="addthis_button_pinterest_share"></a>
                                <a class="addthis_button_google_plusone_share"></a>
                                </div>
                                <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-51bf19d02f28632e"></script>
                                <!-- AddThis Button END -->
                            </div>
                            {exp:channel_images:images entry_id="{entry_id}"}
                                {if image:count == 1}
                                    <div class="slideshow rslides">
                                {/if}
                                <figure>
                                    {if image:description}<figcaption>{image:description}</figcaption>{/if}
                                    <img src="{image:url:large}" alt="{title} Image" />
                                </figure>
                                {if image:count == image:total}
                                    </div>
                                {/if}
                            {/exp:channel_images:images}
                            {blog_body}
                            {exp:channel_images:images entry_id="{entry_id}"}
                            {if image:count == 1}
                                <div class="popup-gallery">
                                    <h4>Click any image below to view a larger version.</h4>
                            {/if}
                            <a href="{image:url:large}" title="{title}"><img src="{image:url:small}" width="75" height="75"></a>
                            {if image:count == image:total}
                                </div>
                            {/if}
                            {/exp:channel_images:images}
                            <div class="comments">
                                <div id="disqus_thread"></div>
                                <script type="text/javascript">
                                    /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
                                    var disqus_shortname = 'new-gaytravel'; // required: replace example with your forum shortname

                                    /* * * DON'T EDIT BELOW THIS LINE * * */
                                    (function() {
                                        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
                                        dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
                                        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
                                    })();
                                </script>
                                <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
                                <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>

                            </div>
                        </section>
                    </main>
                    <div class="sidebar">
                        {lv_sidebar_featured_members}
                        {lv_sidebar_get_the_updates}
                        {lv_ad_sidebar_tower}
                        {lv_sidebar_tweets}
                    </div>
                </div>
            {/exp:stash:set}
        {/exp:channel:entries}
    {/case} 
{/exp:switchee}

Finally, I’m calling the partial from this tag:

{exp:stash:get name='maincontent'}

And here’s the template for the page layout

<!doctype html>
<html lang="en-US">
    <head>
        <title>{exp:stash:get name='pagetitle'}</title>
        <link rel="stylesheet" href="/assets/css/screen.css">
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <!--Scripts before load-->
        <script src="http://modernizr.com/downloads/modernizr-2.5.3.js"></script>
        <script src="//use.typekit.net/yqk6mds.js"></script>
        <script >try{Typekit.load();}catch(e){}</script>
        <link rel="stylesheet" href="/assets/css/magnific-popup.css">
        <link rel="stylesheet" href="/assets/css/responsiveslides.css">
    </head>
    <body class="{exp:stash:get name='bodyclass'}">
        <div class="body-wrapper">
            <header>
                <a href="/" class="logo">GayTravel.com — Travel Guides with a Gay Perspective.</a>
                <nav class="main-navigation">
                    <ul>
                        <li><a class="first" href="{path='gay-friendly-hotels'}">Hotels</a>
                            <ul class="hotels">
                                <li><a class="first-child" href="#">National Chain</a></li>
                                <li><a href="#">Boutique</a></li>
                                <li><a href="#">Bed & Breakfast</a></li>
                                <li><a class="last-child" href="#">Vacation Home/Time Share</a></li>
                            </ul>
                        </li>
                        <li><a href="{path='gay-guides'}">Destinations</a>
                            <ul class="destinations">
                                {exp:low_variables:parse var="lv_gc_destination_subnav" limit="6"}
                                    <li><a class="{if count == '1'}first-child {/if}{if count == total_results}last-child{/if}" href="{url_title_path='gay-guides'}">{title}</a></li>
                                {/exp:low_variables:parse}
                            </ul>
                        </li>
                        <li><a href="{path='gay-friendly-tours-cruises'}">Tours & Cruises</a>
                            <ul class="tours-cruises">
                                <li><a class="first-child" href="{path='gay-friendly-tours'}">Tours</a></li>
                                <li><a class="last-child" href="{path='gay-friendly-cruises'}">Cruises</a></li>
                            </ul>
                        </li>
                        <li><a href="{path='gay-events'}">Events</a></li>
                        <li><a href="{path='top-tens'}">Top Tens</a></li>
                        <li><a href="{path='gaytravel-guru'}">Guru</a>
                            <ul class="guru">
                                <li><a class="first-child" href="{path='gaytravel-guru'}">About the Guru</a></li>
                                <li><a href="{path='gaytravel-guru/sponsors'}">About Our Sponsors</a></li>
                                <li><a class="last-child" href="{path='gaytravel-guru/season-3-signup'}">Signup to Be Our Season 3 Guru!</a></li>
                            </ul>
                        </li>
                        <li><a class="last" href="{path='gay-blog'}">Blog</a>
                            <ul class="blog">
                                <li><a class="first-child" href="#">Davey Wavey</a></li>
                                <li><a href="#">Carlos Melia</a></li>
                                <li><a href="#">Event Spotlight</a></li>
                                <li><a href="#">Videos We Love</a></li>
                                <li><a class="last-child" href="#">GayTravel Guru</a></li>
                            </ul>
                        </li>
                    </ul>
                </nav>
                <form action="" class="destination-search">
                    <label for="destination-input">Where do you want to travel to?</label>
                    <input type="text" name="destination-input" />
                </form>
            </header>

    {exp:stash:get name='maincontent'}

        </div>
        <div class="signup-cta-footer">
            <div class="inner-spacer">
                <h3>Know before you go!</h3>
                <div class="float-left">
                    <h4>Meet up with other gay travelers all around the globe.</h4>
                    <div class="column-collapse">
                        <p>Explore videos, photos, travel tips, maps and top Gay Destinations.</p>
                        <p>Create your profile and make friends around the world.</p>
                        <p>Meet like-minded travelers who share your interests.</p>
                        <p>Post your stories and share your travel tips with others.</p>
                        <p>Browse our events and find the most reliable information about the best gay events around the globe.</p>
                    </div>
                    <a class="button" href="#">Sign Up Now, It’s Free!</a>
                </div>
                <div class="advertisement square">
                    <p class="ad-cta">Advertisement <a href="#">Put your ad here.</a></p>
                    <div class="ad"></div>
                </div>
            </div>
        </div>
        <div class="site-search-footer">
            <div class="inner-spacer">
                <nav class="page-column">
                    <h3>About Us</h3>
                    <ul>
                        <li><a href="#">About Us</a></li>
                        <li><a href="#">Contact Us</a></li>
                        <li><a href="#">Company News</a></li>
                        <li><a href="#">Careers</a></li>
                        <li><a href="#">Media Partners</a></li>
                        <li><a href="#">Partnerships</a></li>
                        <li><a href="#">Advertising</a></li>
                    </ul>
                </nav>
                <nav class="page-column">
                    <h3>Community</h3>
                    <ul>
                        <li><a href="#">Member Profiles</a></li>
                        <li><a href="#">Newsletter</a></li>
                        <li><a href="#">RSS Feeds</a></li>
                        <li><a href="#">Sponsorships</a></li>
                        <li><a href="#">Charities</a></li>
                        <li><a href="#">Gay Travel Awards</a></li>
                        <li><a href="#">Gay Travel Associations</a></li>
                    </ul>
                </nav>
                <nav class="page-column">
                    <h3>Explore</h3>
                    <ul>
                        <li><a href="#">Gay Guides</a></li>
                        <li><a href="#">Events</a></li>
                    </ul>
                    <h3>Plan</h3>
                    <ul>
                        <li><a href="#">Hotels</a></li>
                        <li><a href="#">Cruises</a></li>
                        <li><a href="#">Tours</a></li>
                    </ul>
                </nav>
                <nav class="page-column">
                    <h3>Meet</h3>
                    <ul>
                        <li><a href="#">Profiles</a></li>
                        <li><a href="#">Travel Experts</a></li>
                        <li><a href="#">Blog</a></li>
                        <li><a href="#">Guru</a></li>
                    </ul>
                </nav>
            </div>
        </div>
        <footer>
            <div class="inner-spacer">
                <div class="contact-info">
                    <h4 class="phone-number">1-800 GAYTRAVEL <span>1-800-429-8728 (702-560-5073)</span></h4>
                    <nav class="social-icons">
                        <p>Find us on:</p>
                        <ul>
                            <li><a class="twitter" href="#">Twitter</a></li>
                            <li><a class="facebook" href="#">Facebook</a></li>
                            <li><a class="youtube" href="#">Youtube</a></li>
                        </ul>
                    </nav>
                </div>
            </div>
        </footer>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
        <script type="text/javascript">
            if (typeof jQuery == 'undefined') {
                document.write(unescape("%3Cscript src='assets/js/jquery-1.9.1.min.js' type='text/javascript'%3E%3C/script%3E"));
            }
        </script>
        <script type="text/javascript" src="/assets/js/jquery.flexisel.js"></script>
        <script src="/assets/js/responsiveslides.js"></script>
        <script src="/assets/js/jquery.magnific-popup.min.js"></script>
        {exp:stash:get name='scripts'}
        <script src="/assets/js/script.js"></script>
    </body>
</html>

Are there other parameters I’m missing? I had assumed parse_depth would have solved my problem, but it seems that on a detail page, it doesn’t matter.

Oddly enough, though the rest of the page renders as normal with early parsing turned on, there's an extra {/exp:channel:entries} tag at the bottom; removing the Low Variable causes everything to snap back into place.

I’ve gone through the suggestions so far, and setting the Low Variable element to parse in the regular flow and not early causes it to not parse the code at all.

Thanks all!

2
  • Shouldn't you add parse_conditionals="yes" to your {exp:stash:set name='maincontent'} in your template partial? Jul 29, 2013 at 12:24
  • I thought that might be the case originally, but it seems that parse_conditionals="yes" is applied if you have parse_tags="yes" already. I've tried applying it and no dice. :( Jul 29, 2013 at 15:28

2 Answers 2

2

Try {exp:low_variables:parse var="lv_sidebar_featured_members"} instead of {lv_sidebar_featured_members}

2
  • Unfortunately/oddly, the variable doesn’t even parse in this manner. It's just returns a null value. Jul 29, 2013 at 15:30
  • If it's a Textarea var type, that syntax should definitely work. If it's not, then it might have to do with Stash (not too familiar with it, so not sure). I think Mark pointed at the use of parse_depth="" for getting Stash vars to parse: github.com/croxton/Stash/wiki/…
    – Low
    Aug 9, 2013 at 8:01
2

Is {lv_sidebar_featured_members} set to 'early parsed'? If it is, the problem could be that it contains a channel entries tag and you are nesting it inside another channel entries tag.

1
  • Tried setting it to not parse early, but as a result, it no longer parses the channel entries tag inside at all. I'm starting to think that perhaps I should just throw in the towel and use a regular embed to be done with it. :-/ Jul 30, 2013 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.