This patch adds a formatter that outputs the id of the referenced entities.

This can be useful when formatting an Entity reference field in the Tokens view mode. For example, a module like Custom Pagers can pass this token's value as an argument to a view.

Comments

amitaibu’s picture

> For example, a module like Custom Pagers can pass this token's value as an argument to a view.

Sounds to me that if we are talking about Page manager, it's better to use Relationship to get a proper CTools context, and pass that one to Views.

david lesieur’s picture

I was not refering to Page manager but to Custom Pagers. That was just an example of use; there are probably other cases where one would need to display ids.

jiivonen’s picture

This patch is very useful when creating JSON or XML out put of the some entities, where you may want to have the actual id not (just) the label. I'd like to see it included to the module.

Status: Needs review » Needs work

The last submitted patch, entityreference-entity-id-formatter.patch, failed testing.

david lesieur’s picture

Status: Needs work » Needs review
StatusFileSize
new1.17 KB

Pathnames were incorrect in the patch, sorry. Re-rolled.

damien tournoud’s picture

Status: Needs review » Fixed

Nice! Merged into 7.x-1.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.