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

Template Caching Variables?

Development and Programming

Andrew Smith's avatar
Andrew Smith
95 posts
17 years ago
Andrew Smith's avatar Andrew Smith

Here’s a summarised version of our issue.

We have a plugin that pulls various fields out of a query.

They are then pushed to the template via this method - for example, for author name.

$tagdata = $TMPL->swap_var_single($key, $row[‘author’], $tagdata);

Then our template code for example is:

{exp:entrylinks orderby="latest" weblog="{my_weblog}” parse=”inward”} {author} {/exp:entrylinks}

Unfortunately, when this returns multiple rows, and multiple authors, the Author name will not change.

e.g. if our result set is Jim, Harry, Jim, Ben

EE will output

Jim, Jim, Jim, Jim

Is there a method of variable flushing or something like that, which has been overlooked?

Moved to Plugins: Technical Assistance by Moderator

       
Andrew Smith's avatar
Andrew Smith
95 posts
17 years ago
Andrew Smith's avatar Andrew Smith

Found the issue, it appears EE doesn’t like the use of custom plugins messing with the {author} template variable.

Changing the variable to {entry_author} has fixed it.

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
17 years ago
Sue Crocker's avatar Sue Crocker

Hi, Andrew. This question is more of a programming question than a technical support question, so I moved it.

       

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.