Today I had a problem with some image fields. For my purpose I was manipulating the image style that should be displayed dynamically, and I guess that this odd use was causing for the field to disrespect the setting I had in my view mode for it not to link to the original image. So after a llittle playing around I figure out how to manipulate the image field's renderable array to keep it from displaying as a link to the original image (or to force the linking if you would like).
The renderable array for the field looks like this.
The important part is the key of 0. This is the only image in
The entity API offer us a few theme suggestions that we can use to override how our entities look.
Let's say that you entity type is called "post" and one of your bundles is called "blog", and that you have created an entity with id 1. The following theme suggestions are available:
post.tpl.php post__blog.tpl.php post__blog__teaser.tpl.php (teaser is a view mode) post__1.tpl.php
This offered you a very fine grain level of customization to theme things according to your needs.
To use these tpl.php files we need to let drupal know through the theme hook.
ECK makes the new Drupal concept of ENTITIES accessible to all site builders. Without going into details, we can think of the ENTITY SYSTEM as a two layer hierarchy made available to us to organize our data. Let me give you a few examples on how a two layer hierachy can be used to categorize OBJECTS.
Vendor
Advertiser
Non Advertiser
Vehicle
Car
Motorcycle
Truck
TV
Plasma
LCD
LED
All of these are two layer hierarchies in which we have a CATEGORY of data or OBJECTS, and then SUBCATEGORIES under it. These are the kind of hierarchies that can easily be represented with the ENTITY SYSTEM in Drupal.