Closed (won't fix)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.x-dev
Component:
nodereference.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Aug 2008 at 20:53 UTC
Updated:
29 Jun 2009 at 03:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
sdboyer commentedGreat! Thanks for this, only a handful of people are actually writing new plugins, and I hadn't yet had the time to get around to this one.
Unfortunately, though, I'm not going to commit it. It doesn't make sense to include it directly in Panels, quite simply because of the if statement that appears on line 10 - it should be implemented by nodereference itself. So I'm booting this over to CCK.
Also, three things, two nitpicky and one more serious.
1. Don't abbreviate unnecessarily - in other words, $fname should be $field_name.
2. It may just be a typo, but Drupal coding standards dictate that there's no space after the first paren in a foreach - so
foreach ( content_fields()should beforeach (content_fields().3. More serious - As it operates right now, this would appear on ALL forms with a node context, with no knowledge of whether or not a nodereference field actually exists for the node that's being passed through. There's no way of knowing in beta5, but gordon has recently been working on some improvements to the node context that allows specification of node type - and basically, I'd really rather see this smart enough to be able to take advantage of the typed node context information when it's available. Really doing so properly won't be available for a little while yet, I don't think, but I think it's an important goal to keep in mind.
We also might have to rejigger the Panels API a bit to give you the full flexibility you'd need for to accomplish such a thing, but I'd be willing for plugin.
Comment #2
schuyler1d commented@1, WRT '3. More serious', I took a preliminary look at what might be involved to make this possible. The least would be:
3.1 panels_[[relationship]]_settings_form($conf) needs a second argument ($conf, $context)
3.2 Choosing a different context in the add/edit relationship form needs an ajax-form refresh
3.3 Getting the node type into $context for nid, node-edit, node-add (btw, is there a reason why node-edit/node-add are different arguments rather than 'content types'?)
If I could see where gordon's going with 3.3 (either after a commit, or a link to a current patch? or an email?) I'd be willing to help with 3.1 and maybe 3.2.
This upload corrects the minor style issues, though for CCK, we'd obviously also get rid of the module_exists('nodereference') test, put the file in a panels_relationships/ directory, and then make a function with something like:
Comment #3
karens commentedA very old feature request for D5, won't do anything with this now. This is possible in D6 now with Views 2.