Panels overides any php code you place for block visibility, it doesn't matter what php code you place in a blocks visibility section it is ignored by panels. This means its impossible to use panels for any post login sections of a site at the moment.

I have tried a range of code, but have been attempting to set all blocks to not be visible to unauthenticated users and show the login block instead. Any ideas how this could be achieved?

CommentFileSizeAuthor
#1 block.inc_.patch1.38 KBslantview

Comments

slantview’s picture

Assigned: Unassigned » slantview
Status: Active » Needs review
StatusFileSize
new1.38 KB

Here is a patch with the fix requested.

/v

johntymatts’s picture

thanks will test it out

merlinofchaos’s picture

Status: Needs review » Fixed

You get 3 or 4 thank-yous for this patch! Committed and will go out in 1.1 today.

Anonymous’s picture

Status: Fixed » Closed (fixed)
Anonymous’s picture

Version: 4.7.x-1.0 » 5.x-2.x-dev
Category: support » task
Status: Closed (fixed) » Active

this needs to get into panels 2 but I think we need to add a checkbox or a textarea to override it or something to allow for the php visibility code. Reason for it, in my opinion panels gives you the ability to control blocks on their own without how they are controlled through admin/build/block and thus if the block is enabled in admin/build/block and has visibility code, that code is for that region.. what if the user wants different visibility code for that block when its in a different region (panels) ?

Just like override title by visibility code.

Anonymous’s picture

this needs to get into panels 2 but I think we need to add a checkbox or a textarea to override it or something to allow for the php visibility code. Reason for it, in my opinion panels gives you the ability to control blocks on their own without how they are controlled through admin/build/block and thus if the block is enabled in admin/build/block and has visibility code, that code is for that region.. what if the user wants different visibility code for that block when its in a different region (panels) ?

Just like override title but visibility code.

eaton’s picture

Indeed -- I have a client who was taken off guard by this change. They're using PHP visibility code to control the block on the rest of the site, but want to 'force' it to appear in the panel.

merlinofchaos’s picture

Version: 5.x-2.x-dev » 5.x-1.2
Status: Active » Closed (fixed)

I need to mark other issues as a duplicate of this, and I'm not carrying the basic block visibility stuff forward into Panels 2 because of the reasons outlined here, anyhow. That said, block visibility is in 1.2

merlinofchaos’s picture

Title: Block visability » Block visibility