Closed (duplicate)
Project:
Chaos Tool Suite (ctools)
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Jul 2009 at 20:50 UTC
Updated:
30 Oct 2010 at 10:46 UTC
For instance, I have a cck text checkbox that makes a post into a blog.
I want to be able to use a certain panel on it if the checkbox is checked, and not if it is unchecked.
Thanks!
Comments
Comment #1
merlinofchaos commentedThat would be awesome. This is not a 5 minute task, and is going to require a wider of view how to set up so that it's configurable without being an absolutely insane UI. In a way this stands to be as theoretically complex as Views filters.
In the short run, I think we need a PHP code access plugin. It's also plausible for people to write their own customized access plugins. This one in particular would make a good tutorial.
Comment #2
Flying Drupalist commentedThank you, when I was first thinking about this I thought it was fully possible and imagined in my head views filters. It was only later when I actually tried to do it that I realized it was only in views and not panels.
Yeah I would love a PHP code access plugin short term solution.
Thanks a lot!
Comment #3
merlinofchaos commentedTHis is properly a chaos tools feature. Maybe Markus would like to take a look at this sometime?
Comment #4
merlinofchaos commentedThere is now a PHP Code access plugin.
Comment #5
Flying Drupalist commentedThanks a lot, can you give an example for how to check if a field has value?
Comment #6
markus_petrux commentedI'll take a look at this as well to see if I can help in one way or another.
Comment #7
markus_petrux commentedhmm... so if we have a PHP Code access plugin that has access to all contexts, then maybe all we need is a few sample snippets somewhere that help figure out how to deal with CCK Fields?
This is basically because creating an access plugin for CCK Fields may require a lot of stuff. For example, how do we build the settings form for fields of type foo or bar. I'm thinking this would require something on the line of filter handlers in views, where we have a basic form that can be overriden by other fields. I think it is not possible to provide a form that allows to customize filters for any CCK Field in the world. This would have to be implemented by the fields themselves, and they also do this for views... so do we really want to duplicate this stuff here?
Comment #8
merlinofchaos commentedI think you're right, Markus. Creating a few snippets and putting them into the documentation is a good way to go. I'm working on a structure for the advanced help right now, so that in the -rc there will be some placeholders and links to issues.
Comment #9
blup commentedsubscribing
Comment #10
Flying Drupalist commentedHi guys, has this already been implemented?
Comment #11
autopoietic commentedsubscribing
Comment #12
itangalo commentedSubscribing!
Also, here's a snippet that checks a CCK value for a node in the regular node template panel:
The two first lines could be put directly into the return statement, which would give you a bit more speed and a lot less readability.
Cheers,
Comment #13
nevets commentedI would guess that
should be
If not, why load the node and where does $main_tag come from?
Comment #14
merlinofchaos commentedLet's combine these two issues: #618214: context_field access plugin -- marking this one dup as that one has a plugin that probably needs more refinement.
Comment #15
ayalon commentedThe example above does not work with cck fields.
There is still no selection rule for CCK fields. I'm not sure if a node_load() is a performance issue before the page has been selected.
Comment #16
itangalo commented@nevets: You're absolutely right. Thanks for spotting this (and sorry for my miss when changing variable names).
@ayalon: This issue is now persued at http://drupal.org/node/618214, so I'm marking this as a duplicate again.
If you want to discuss the particular snippet, it is probably better to do it at http://groups.drupal.org/panels.
I'm posting the snippet again, for clarity. (Note that you have to change "argument_nid_1", "field_name_here" and "'your condition here'" in order to get it working. Uncommenting the dpm line will help in finding new values.)