as far as i can see, there is unfortunately no support for the relation module yet.

Comments

dave reid’s picture

Title: relation module support » Add relation tokens
Project: Token » Relation
Version: 7.x-1.0-beta7 » 7.x-1.x-dev

Token can only provide support for Field API fields - in which case modules that provide fields need to read http://drupal.org/node/1252608. Otherwise since Relation is not in core, we cannot provide tokens for it. Either way, transferring to the Relation issue queue.

videographics’s picture

Issue tags: +token

Dave's point does seem to highlight a fundamental difference between the Relation module and the 'Reference' modules we've been using up until this point.

What if we had field type that could be configurable with options to select different types of related entities and their associated fields, and then serve them up dynamically? I can imagine this might get a little hairy with the potential for any amount of stuff coming in from any number of entity types, but I thought I'd at least the concept out there for discussion.

By doing this, we would essentially be creating 'phantom' reference fields (based on content connected using the Relation module) which should then allow Token to work its magic. It seems a little crazy to be creating something that looks and works so much like an old-fashioned node reference out of our newfangled Relations, but I can imaging this ultimately being pretty useful.

In general, I do think there would be some interest in having some way aside from Views for pulling in fields from Relation-related content.

mustanggb’s picture

Component: Code » API

Very interested in token support also
Perhaps a relation maintainer could chime in with regards the direction we should be taking

Should we:
a) Attack it from Relation alone, just accepting that Token only supports fields and hence do some sort of phantom field trickery
b) Persuade the guys over at Token to support more than just fields which would improve coding practices, readability, maintainability etc. (would adding entity support to Tokens do it?)

I would tend to opt for the latter

jlyon’s picture

I created a patch that adds a display formatter to display the relation endpoints as a "story" with tokens: #1479346: Create a display formatter to display relation_endpoints with tokens.

Richard_1618’s picture

Version: 7.x-1.x-dev » 7.x-1.0-rc2

I'd also really appreciate and be interested in this - I've got node/contacts and creating relations with them I would like to be able to show a block (Related to) of custom fields in the contact showing

Related to:
Spouse : Debby Smith
Works with : Jack Danials
Sibling : Michelle Smith

At the moment I've put in the [

Amazing module!!

jlyon’s picture

@Richard: have you tried the patch at #1479346: Create a display formatter to display relation_endpoints with tokens? It gives you access to all of the fields for each endpoint entity, so you should be able to create a list like you are describing.

nevergone’s picture

What would there be need for in order for the solution of the issue to go on?

Quote #1379138: Add Support for Pathauto and Token:
"For example, a site builder creates directional relationship between two node bundles, "A [is parent of] B" and "B [is child of] A". Next, the builder sets a URL alias pattern, which could look something like [relation:is-parent-of:node:title]/[node:title] for nodes of content type B."

nevergone’s picture

And now…? :S

jlyon’s picture

Have you tried the patch at http://drupal.org/node/1479346?

naught101’s picture

Status: Active » Closed (works as designed)

This issue doesn't really seem useful anymore. There are tokens in relation, and work on tokens in formatters at #1479346: Create a display formatter to display relation_endpoints with tokens. If there are any specific bug reports of feature request (new tokens, etc.) please post a new, detailed issue to the relation queue.