Using slideshow block in composer

Permalink
I'm trying to set up a composer page with a ton of stuff on an older 5.4.2.1 site. One of the things they want on the page is a slideshow block. Because there is no edit form for the slideshow, it just has the little button to pop open the block edit form and that seems to work fine.

What is not working fine is the fact that the slideshow is slipping under other form elements on page load. So I set up some code like this to hide it:

<?php 
$currentCID = Page::getCurrentPage()->getCollectionID();
$composerCID = Page::getByPath('/dashboard/composer/write/')->getCollectionID();
if ($currentCID !== $composerCID){?>
// output slideshow
<?php } else { ?>
<h2>Slideshow disabled in composer.</h2>
<?php } ?>


This seems to work fine, but only until you actually edit the block. Then it comes back with the current page ID being the actual composer page's ID, so it no longer matches with the write page's ID, and you see the slideshow.

I'd use edit mode to check if it should be output, but the composer page isn't actually in edit mode so this doesn't work.

Is there some way to know for sure if this block is displaying or being edited on the composer page so that it doesn't output the slideshow? When you load in the edited slideshow block in via ajax it actually displays correctly and doesn't slide under the other blocks, but that is kind of disconcerting to the end user - why does it suddenly show up when you edit?

How do other people handle things like this?

hereNT