I have a 'Gallery' content type that has an entity reference field, which I use to reference other nodes of the 'Gallery Item' content type. When creating a 'Gallery' I use the nodeblock module to automatically create a block with this content.
So when I place this block in any page, let's say the homepage, I have it displaying the 'Gallery' title and a body on top, and below that, each 'gallery item' using the 'rendered entity' field formatter.
What I also need, is to somehow display the node id of each 'gallery item'.
I've tried editing the entity reference field template by creating a custom field.tpl.php template for it, but I can't find a way of accessing the node ID of each corresponding item.