Custom block preview when viewing stack in dashboard?
Permalink
Is it possible to have an alternate layout for a block that is in a stack, when you are editing the stack contents? I have a complex layout on my page that is not rendering well in the stack editor.
I know you can create a PHP file in the blocks folder for a different layout when viewing something copied to the clipboard. Is there anything similar for blocks in stacks?
I know you can create a PHP file in the blocks folder for a different layout when viewing something copied to the clipboard. Is there anything similar for blocks in stacks?
<?php
$isDashboard = false;
$isStacks = false;
if (Page::getCurrentPage()->getCollectionPath() == "/dashboard/blocks/stacks") {
$isDashboard = true;
}
if (strpos(Page::getCurrentPage()->getCollectionPath(), '!stacks') !== FALSE) {
$isStacks = true;
}
?>
Note that "$isStacks" will not be true until you edit a stack block and save it to the stack, so you need both isDashboard and isStacks:
if ($isDashboard == true || $isStacks == true) { ?>
... do this ...
<?php } ?>