Timeline for Render image that is linked
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 2, 2018 at 17:10 | comment | added | tobias554 | I don't have an entity and I don't want to use managed files. What do I need to pass as image/item ? I only have the uri to the image. | |
Feb 2, 2018 at 17:02 | comment | added | Leigh | Yes that would work by the looks of it. So in the test code it has: $base_element = array( '#theme' => 'image_formatter', '#image_style' => 'test', '#item' => $entity->image_test, '#url' => Url::fromUri('base:' . $path), ); With $entity->image_test being the image object from a field by the looks of it api.drupal.org/api/drupal/… | |
Feb 2, 2018 at 16:39 | comment | added | tobias554 | isn't there any possibilty using '#theme' => 'image_formatter' ? I don't know how to use it. The documentation says: Available variables: * - image: A collection of image data. * - image_style: An optional image style. * - url: An optional URL the image can be linked to. However I don't understand what to pass as image. | |
Feb 2, 2018 at 15:39 | history | answered | Leigh | CC BY-SA 3.0 |