Usage examples for entity_formatter_wrap()
entity_formatter_wrap() is a helper function to wrap field values with some markup and labels. Its wraps your field values with HMTL with a
For a general introduction to the Entity Formatter module view its module page.
The full API Documentation can be found here: http://entity_formatter.valderama.net
print $page->getImages()->setImageStyle('thumbnail')->img();
if ($page->getImages()->isDeltaValid()) {
print t('Images') . ':';
print $page->getImages()->img();
}
foreach ($page->getImages() as $image) {
print $image->setImageStyle('thumbnail')->img();
}
if ($page->getImages()->isDeltaValid(3)) {
print $page->getImages()->setDelta(3)->img();
}
$num_to_print = min(3, count($page->getImages()));
for ($delta = 0; $delta < $num_to_print; $delta++) {
print $page->getImages()->setDelta($delta)->img();
}
The module provides a single drush command "entity-formatter-make" or short "efm".
drush efm node --bundles=page,article --module=entity_formatter_custom
This example generates formatter classes for page and article node types and place them in the entity_formatter_custom module (generating module if not exists).
entity_formatter_wrap() is a helper function to wrap field values with some markup and labels. Its wraps your field values with HMTL with a