Droplets question

Are there any limitations on placing the Droplet stack on the page - specifically, is it OK to place it at the top of the Partial that’s placed at the top of each page, or does it need to be outside of a Partial?

Reason for the question is that I tried it inside a Partial, but it only displayed correctly on certain pages, just showing the {{banner-tagline}} on others, even after clearing Cache.

I’ve now taken it out of the Partial, and it works fine, so maybe something to look at with @isaiah?

Droplets are already essentially mini-partials on their own.

Are you trying to place the Droplet stack in the Partial or the {{droplet}} tags in the Partial? A screenshot (and a cup of coffee) might help me decipher it this morning. :wink:

If it is just the stack, I would encourage you to not place that in a partial. It is an innocent looking stack, but it does a some crazy stuff. This is why it needs to be the very first thing at the top of your stacks page. Since there are no settings in it, it shouldn’t really need to be in a Partial anyway.

I’ve taken the Droplet stack out of the Partial and it works perfectly now.

I was just being lazy with the Partial, so I didn’t have to drag the stack to each page!

Now I know it’s Partial-like, I won’t try it again (but I bet I won’t be the only person to try it). Curious that it worked fine on some pages, but not others, despite that particular Partial always being top of the page. :man_shrugging:

1 Like

Cool, glad it is working for you. Jamming that stack into a Partial could do weird things I suspect.

Basically that stack causes the page to stop outputting content to the browser, and jams it all into a special variable, which I search through and look for {{droplet}} tags to replace. I replace them and then spit the_whole_ of the variable’s contents back out to the browser. Putting that in a Partial might be troublesome.

Might be worth sticking a warning in the Documentation, when (if) you get a minute… :grinning:

1 Like

I’m not sure I understand the situation. Usually partials don’t affect much. They’re just sort of a fancy UI around a One Column Stack (just our secret, don’t tell anyone, OK?)

In edit mode the Partial editor doesn’t bring along all of the styles from the rest of the page – only the styles of the things inside the partial. That makes editing a partial feel nice and fast, but sometimes causes trouble with frameworks that like to include a lot of styles in one stack.

If there’s something that I can do to help out, just let me know. If there’s a bug I should look at, just package up the page – just with the troublesome stack, leave everything else out. Then send it over to me, or share it here, or whatever works for you. :smiley:

Isaiah

Nothing for you to worry about. The Droplets stack just needed to not be in a Partial, so problem solved!

1 Like

As I mentioned above, partials shouldn’t really affect things.

Can you explain why/how a partial is affecting this stack?

Perhaps I’m not seeing the bigger picture, but at least to me, this sounds like a bug that needs to be resolved, not something that needs to be dismissed.

Hi Isiah,

The Droplets stack needs to be the very first element on the page, as it parses the {{droplets}} used on the page. Being lazy, I put it as the first stack in the Partial that sits at the top of each page on my site, thinking that would save me dragging it to the top of each page.

It worked on some pages, but not others - same pages each time - just displaying “{{banner-tagline}}” rather than the intended text content of the droplet. 7 page site (see? LAZY!). Didn’t work on pages 1-4, but 5-7 were fine. Nothing particularly different between those that worked / didn’t work… :man_shrugging:

Sadly, I’m not sure I can add much value to an investigation, other than to say that I’m happy with Adam’s caution not to put this particular stack in a Partial (Accepting, rather than Dismissing), as I have no technical knowledge of how the Droplet stack does it’s magic, or how Stacks creates the page, using Partials.

I’m sure Adam can explain the workings, and why the combo might cause an issue, though. I’m happy to package up the Project, if that would be of value, given that the droplets are stored on the Server as MD files?

OK. yep. this definitely seems like a bug now. that should definitely work. partials shouldn’t have that sort effect on anything.

is it possible to get a copy of the broken project – if you still have a copy. or even a copy of the working project – i think i can put the droplets stack back into the partial myself.

or is there someone else who can help me set up a super simple Droplets project??? the simpler the better!!! so even a two page project with a few stacks on each page would be fine – but it needs to show off the problem

whoever reads this and can help out, here’s how to share the project with me:

https://yourhead.zendesk.com/hc/en-us/articles/360033849994-Sharing-Your-Project-and-Add-ons

when i have both of those things mentioned in the link above, i can probably fix this one and allow everyone to “be lazy” (i.e. do a lot less work) with these things forever. because after all, being lazy (i.e. doing a lot less work) is what partials are all about!

to me, it sounds like one of the files needed for the script to work is not being exported correctly. this wouldn’t be a huge surprise since we worked hard to optimize the way partials export content to make theme much faster. every change carries a risk of introducing a bug – and that optimization meant a lot of big changes.

oh, and @jacksona – if you can’t provide a file, i understand. but i still want to say an extra big thank you to you for providing the detailed description of what you saw.

you already have! that’s exactly the sort of description that helps get a bug hunt going. there’s still a ton of work to be done, but this is where it all starts: from users noticing something strange – and letting me know.

Thanks again,

Isaiah

1 Like

Hi Isiah,

I’ve recreated the project from my working version, and you have mail.

Best,

Adam.

Hi Adam,

Thanks for sending me the project and addons. I have never used allow except when Adam sent me things for testing – so my knowlege is very limited, but I dutifully watched all the tutorials to try to come up to speed.

But I’m afraid your file seems to be working. At least in my limited test. And as I understand the problem.

Here is what I did:
I opened your project, changed the editor password, added a single droplet for the header text. I didn’t try replacing anything else or on any other page.

It seemed to work exactly as expected. I changed nothing else about your example project. I did not change any page layout, put anything into or take anything out of partials.

My understanding of the bug:
I was under the impression that the droplet replacement simply wouldn’t work at all in the current state (the foundry stack, the droplet stack and the content are all in partials – i didn’t change any of this). But as you can see in the screenshot below, it seems to be working fine.

Perhaps there’s some detail here that is important? Maybe it doesn’t work in some particular context? Or maybe on a particular page? Or maybe with some particular content? Perhaps replacing something a bit more complex like an image? or some styling? or some styling images?

But I think this example shows that the droplet is functional. And it is doing at least some replacement in the way that’s intended. – Even when inside a partial.

@elixirgraphics - i saw in the documentation that you also suggest avoiding partials. do you know what this bug is that we’re trying to avoid and how to make it happen?

if you’d like i can set up a little php server so that we can play with pages live and try different things out. i’ve been doing this with MAMP, but haven’t really come up with anything.

maybe it was a bug? like in Stacks 3 or Stacks 4.0.4? or is this something you saw recently?

Isaiah

Thanks Isiah, appreciate you taking the time to look into this.

Did I it work on EVERY page? I saw it working on some, but not others.

Would you mind removing the image, please? GDPR… :slight_smile:

Image removed. Sorry. I didn’t know how else to show it without showing it. LOL.
I didn’t try other pages. I figured the partial problem would affect the page where the partial was?

I’m happy to look elsewhere. Just tell me what to do or where to look.

I should just look at where ever you see the problem in the same file? Where is the problem when you look at this project file?

No problem, re the image - just paranoid!

The Droplet stack should be at the top of the “AJ Base Style” Partial, which is on most of the pages. If it displays correctly on each of the navigable pages, then I guess it may have just been a glitch perhaps on my part.

is it working for you now? i assumed that you could see the error yourself before you sent me the file.

I did. However, I’ve just tried republishing, and it seems to be working! No idea why/how.

Frustrating.

this doesn’t surprise me. this happens to me so often, it should have a name, like Murphey’s Law or something.

often bugs are much more complex than they seem on the surface. when people first come in contact with a problem they make assumptions about how the bug works, where it exists – and those assumptions are just best guesses. often overly simple. and… they’re often wrong.

the key here is to remember that it’s a wiley bug that likes to hide – so whenever one of us sees it next, we need stop whatever we’re doing for 30 seconds, and just capture that whole environment as much as possible so that we can save it, rewind it, and replay it in slow motion inside a debugger – that way we can understand it completely, which is what’s required to fix it. that extra 30 seconds is always a hassle, but it saves sending a developer off for 3 or 4 hours chasing ghosts. i’m pretty used to it, it’s no big deal – and every experiment gives us some information – so it’s not worthless. but it’s still pretty frustrating to spend so long learning, building, testing, only to come up empty handed. :disappointed:

so what we don’t want to do is make assumptions about where this bug is, that just wastes time. and not just mine…

…think, if this stack does actually work fine in partials, think of how much extra work every user has had to do. instead of just dropping this stack in one partial and being done, they’ve had to copy and paste it to every page. what a bummer.

so, the next time you see it. just kind of pause for a second. do a save-as on your project. and maybe even grab a copy of your web-server directory. the droplet content (which might be part of the issue – who knows) is in a folder called droplets.

and ask yourself… what was the last thing you did, what’s different about this situation? is the computer different? the server? the content? did you recently update RW or Stacks or one of the stacks on the page? is the page in an interesting location in the site hierarchy? does it have an interesting name? every detail is potentially useful info.

and with some teamwork, and a little luck, and a lot of patience – i think we’ll figure this one out. i’m pretty sure this bug is out there. i’m pretty sure we weren’t imaging it the last time you saw it. so it’s only a matter of time before it pops up again.

good luck at breaking Stacks. :rofl:

Isaiah