Can't hide block

Permalink Browser Info Environment
Just installed the plugin, made a background and now i can't hide the block itself.
If I use andvanced permissions- it hides the block and the background too.

Type: Discussion
Status: New
majorius
View Replies:
hereNT replied on at Permalink Reply
hereNT
The view for the block has an edit mode check to show something to click on in edit mode. If you changed something in the view, you will see this, at least, every time someone has complained about the block not hiding it's been this. My suggestion is to download a fresh copy of the block and not edit the view, see if that fixes your problem.
majorius replied on at Permalink Reply
majorius
found a solution- I've put
opacity: 0.0; in block design, i can see the background and the block is hidden
hereNT replied on at Permalink Reply
hereNT
That's nice, but the block by default hides itself when you leave edit mode. Did you edit the view to begin with, or is something else causing problems?

The code in /herent_backstretch/blocks/herent_backstretch/view.php should look like this:

<?php  
defined('C5_EXECUTE') or die("Access Denied.");
$myJS = $controller->getJS();
print $myJS;
$myPage = Page::getCurrentPage();
if ($myPage->isEditMode()){?>
<div class="backstretch-block">
   <h3><?php  echo t('Backstretch Block');?></h3>
   <p><?php  echo t('Refresh or publish the page to see changes.');?></p>
</div>
<?php  } ?>


If it looks like that, you should see the block in edit mode but not when the page is not in edit mode.
majorius replied on at Permalink Reply
majorius
no, didn't change the code, some plugins have little problems with Russian package of concrete.
View.php looks like

<?php
defined('C5_EXECUTE') or die("Access Denied.");
$myJS = $controller->getJS();
print $myJS;
$myPage = Page::getCurrentPage();
if ($myPage->isEditMode()){?>
<div class="backstretch-block">
<h3><?php echo t('Backstretch Block');?></h3>
<p><?php echo t('Refresh or publish the page to see changes.');?></p>
</div>
<?php } ?>
hereNT replied on at Permalink Reply
hereNT
Very weird, I don't know why that would work any different in the Russian version of concrete 5, Page::getCurrentPage() and $page->isEditMode() should both still be working. Unless there's something else that I'm missing, but I don't have a clue what that could be.

At any rate, glad you got it working...
FatTony1952 replied on at Permalink Reply
FatTony1952
I'm having the same issue. It keeps showing:

Backstretch Block
Refresh or publish the page to see changes.

even when I logout.

Not sure what the problem is.
FatTony1952 replied on at Permalink Reply
FatTony1952
Some pages have it, some don't.
hereNT replied on at Permalink Reply
hereNT
I've tracked this down to the block cache - apparently it was pulling the cache instead of using the actual view of the block, the cache was set while in edit mode.

I've published an update to version 1.1 that should address this by no longer caching the block at all. Let me know if this doesn't work for you.
FatTony1952 replied on at Permalink Reply
FatTony1952
Thanks! Much appreciated!

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.