I am testing an upgrade from alpha4 to beta1 and cannot find the option "Use block visibility settings" when embedding a block in a pane.
I have a pane with 2 blocks that show one at a time based on PHP code (It is a site for a weekly broadcast, so during the broadcast there is a link to the live streaming, while the rest of the week there is a link to the last one). Now are both links showing up. How can I replace that functionality in the new version?
I am thinking in a custom PHP code that show different links based on the conditions that are currently in the block visibility, but before going that way I would like to check that I am not missing something about the new version.
Thank you very much.
Comments
Comment #1
merlinofchaos commentedI've decided not to implement the PHP block visibility, though you do in fact have a rare instance where such a thing would have been useful I suppose. As Drupal progresses, we are learning more and more that embedding PHP code directly into your site is a bad thing and the block visibility code is ugly and 98% of the time not useful for Panels anyhow.
In your case I would recommend writing a custom access plugin, which should be very very small, and you can use that to control the pane visibility. This would put the PHP where it belongs and allow you to easily re-use this PHP, make updates, deploy, etc.
The downside here is that the documentation on writing these plugins is not yet done, so the only thing you can do is look at existing access plugins as an example. The good news is, your plugin should be *really* simple.
I recommend looking at ctools/plugins/access/perm.in which is the simplest of them. You probably don't need a context, you can just check whatever it is you're going to check. Your settings form should have a yes/no switch, so you can test for broadcasting: yes or broadcasting: no, and your check function can do the actual test.
The other bits you need to know are available in the CTools advanced help, in the plugins-implementing topic.
Comment #3
brunodboI'm looking for the other two block visibility settings: IIRC, in Panels 2, you were able to specify whether or not you wanted to respect the block visibilty settings. Was this option completely removed from Panels 3 in favor of access plugins? If it's still there, I can't find it ...
Comment #4
trapdoordesigns commentedhey everyone!! i looked everywhere and i cant seem to figure this out because it's the least helpful error message i have ever gotten!!!!!!!!!!!!!!!!!!!!!!! " the file could not be created"
I just created a page....placed a block in a panel and displayedthe panel on the page, now it shows me this error: " the file could not be created"
any suuggestions?
Comment #5
merlinofchaos commentedbrunodbo: As I said in #1, I decided not to implement this feature in Panels 3, because I believe it is a bad way of doing things. Panels 3 offers other, IMO better alternatives.
#4: Can you at least find issues that are sort of related to your problem? =(