#211324: Display arbitrary data from referenced node in refererring node already discusses this, but this module is probably a more appropriate place than core CCK. Would you be interested in allowing CCK Attributes to use Node references (or maybe even User references, and, now I come to think of it, more things like Number and Date fields would be pretty useful too)

Would you be interested in extending CCK Attibutes in this way? I would be willing to help out, submit patches, etc.

Comments

mckeen_greg’s picture

Title: Nodereference field as value? » Extending Attributes Module to Provide other field types.
StatusFileSize
new3.74 KB

Hi naught101,

As you can see from previous issues that have been opened, this is the plan. Eventually, I should have time to take a look into this. I have been able to provide a "Select" value for the Attribute Field - but not the Value field so far.

I am a "junior" programmer at a Drupal Contrib level, and thus implore the community to help provide the necessary patches to get this module where it needs to be.

Finding time to work on it is also a difficulty I think we all face. So, if you can help with patches, that would be greatly appreciated.

I have attached the current version of an "attribute select" module. Its a clone of this one, and has the ability to provide a select box for the Attribute field. This needs to be merged into the Attribute Module (havent even started looking at yet). This should be a start, but warrants further discussion into HOW we provide the functionality.

If you would like to discuss this further with me, please contact me via my contact form, and we can set up a Skype meeting.

Greg

naught101’s picture

Ah, crap, I just realised I linked the wrong issue in the original post. I meant #704712: Abitrary reference names for node reference. Sorry for any confusion.

I'd would love to help out. I'll have a poke around in the module over the next couple of days to get a feel for it. would be rockin' to get this going.

naught101’s picture

For the label, if you just check the number of values in $options around line 202 in attributesselect.module, then you just make the attribute a textfield if there are no pre-defined options. It's a simple, neat solution that doesn't make things more complex. Might need some more help text in the field settings.

 if ($options) {
 $element['attribute'] = array(
    '#title' => t($field['attribute_label']),
    '#type' => 'select',
...
}
elseif {
 $element['attribute'] = array(
    '#title' => t($field['attribute_label']),
    '#type' => 'textfield',
...
} 
naught101’s picture

Status: Active » Needs review
StatusFileSize
new6.25 KB

Ok, this merges the two modules, and should apply to the current CVS head. Works for me.

I've partially introduced a slightly different nomenclature. An "Attribute" (field) is made up of a "Label"/"Value" pair. I think this removes a bit of ambiguity. I can re-do the patch if you agree, to include all instances.

ManyNancy’s picture

I'm now using CCK3's multigroup functionality to have a text field on the left and a node reference field on the right side. Would it be possible to upgrade from multigroup to this module?

naught101’s picture

@ManyNancy: you probably should open a new issue about that, since it's not directly related to this issue. It's definitely worth discussing though - I'm still not sure whether this module is more suitable for my purposes than multifield...

ManyNancy’s picture

I applied #5 to the latest dev, but do not see a way to select the field type. There's no select field or anything.

Pretty confused.

Thanks for making a great module.

fschaff’s picture

Version: » 6.x-1.x-dev

Thanks for the tip
but how I can apply an input format to the fields ?
Thanks

hanskuiters’s picture

@naught101: Thanks for the patch #5. Works like a charme! I use it in combination with Computed field, as in catch the values of the attributes and pass them to a custom module. For end user this field is now easy to use.

Tarch’s picture

StatusFileSize
new5.14 KB

Hi,
I've added an option that allows to use a taxonomy as the list of allowed labels.
Attached you find the patch.