We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

$TMPL->var_single is empty

Development and Programming

Erskine's avatar
Erskine
46 posts
17 years ago
Erskine's avatar Erskine

It’s getting late, my eyes are sore, and I don’t know why this template code:

{exp:weblog:entries weblog="galleries_2007" limit="1"}

    {entry_id}

    {exp:esk_faf:nominated_artists gallery_id="{entry_id}" year="2007"}
    
        {yby_trans}
            
        {yby_year}
            
        {yby_media}
            

    {/exp:esk_faf:nominated_artists}

{/exp:weblog:entries}

is getting its entry_id (and other weblog_titles data) parsed but not the custom fields. They are just being removed. I have looked in all of the arrays of data in the plugin and all SQL results are correct, it’s a parsing issue. The parsing is simple though, prep_conditionals, then swap the vars.

When I look in $TMPL->var_single it is an empty array (or an array containing only {entry_id}.

Any ideas, I’m starting to consider a career change.

Glen.

       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

Is esk_faf a module or a plugin? And, what happens if you just use that code without wrapping it in the weblog module?

       
Erskine's avatar
Erskine
46 posts
17 years ago
Erskine's avatar Erskine

esk_faf is a plugin. I have stripped the template code down for clarity but imagine I have:

{exp:weblog:entries weblog="galleries_2007" limit="1"}

    {entry_id}

    {exp:esk_faf:nominated_artists gallery_id="{entry_id}" year="2007"}
    
        <div>
            {yby_trans}
            
            {yby_year}
            
            {yby_media}
        </div>    

    {/exp:esk_faf:nominated_artists}

{/exp:weblog:entries}

it would return:

21369
<div>
    
    
    
</div>

<div>
    
    
    
</div>

Which is correct, except all the variables have gone, I have check the SQL results through the process of the plugin and they contain all of the correct data - it even returns 2 set of empty html so it knows how many records are returned.

I think it is perhaps an issue with the multiple site manager and the cache - so I’m looking into that now.

       
Erskine's avatar
Erskine
46 posts
17 years ago
Erskine's avatar Erskine

RESOLVED.

I took it all apart and re-built it using a few more embeds and everything seems OK now. I think it was a coukpe of issues coming together to cause the problem and I had only ever eliminated one at any time… until now.

       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

All the same, was the plugin properly returning the $TMPL->tag_data string?. Could be many issues at play here. For example if the {yby_etc} variables belonged to the parent (wrapping) weblog then they would be parsed out before the plugin got to see its tagdata - so echo’ing or print_r’ing $TMPL->var_single, from within the plugin code, would result in nothing being shown.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.