Extension

Archived
Forum
(read-only)

CacheCracker

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Isaac Raway

     

Same Embed Included Multiple Times Results in Repeating Content

General

Ottergoose
Ottergoose

How do I prevent multiple inclusions of the same embed (same template, different parameters) from repeating in the output?

Example pseudo-code:

{embed="example/_say" say="Howdy!"}
{embed
="example/_say" say="Hello!"}
{embed
="example/_say" say="Hi!"

I’m expecting “Howdy! Hello! Hi!,” but the template is rendering “Howdy! Howdy! Howdy!”

MetaSushi
# 1
Developer
MetaSushi

Hey Nick,

Have you applied the custom hack? Depending on what add-ons you have installed, that would be needed to get this to work properly. In theory it should work even without the hack if you are not using any special URL routing add-ons. Basically what the hack does is replace how cache hashes are generated with our own logic, which is very likely related to the duplicate output (somehow the same hash is being generated even though the parameters are different). If that doesn’t help we’ll take a look in the code and see what is happening…

Also, what version of ExpressionEngine are you using? Could be an issue specific to your version as well.

Ottergoose
# 2
Ottergoose

Hey Hey!

Have not applied the custom hack, although the embeds are getting squirreled away into a Stash variable, if that’s a potential factor. We’re running 2.7.2 on this install.

I’ll apply the hack and let you know what the results are.

MetaSushi
# 3
Developer
MetaSushi

Just thought of something else, try using late global parsing (requires Wallace) if the above doesn’t work:

{#embed:say#} 
MetaSushi
# 4
Developer
MetaSushi

Is there any way to test the code without Stash? I would count that as highly likely to be involved in the cause.