Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 710 Vote(s) - 3.56 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I output a drupal image field?

#1
It is quite possible that I'm just looking for help finding the name of a function that already exists within drupal (7) but sometimes the documentation is a bit difficult to navigate. Hopefully someone can help me.

I have a node that has a custom field.

I am working within a template `field--mycustomcontenttype.tpl.php` and so am trying to find the name of the PHP function that outputs and image field with image styles.

`mycustomcontenttype` is a NODE with the following additional field:

[field_image] => Array
(
[und] => Array
(
[0] => Array
(
[fid] => 51
[alt] => ImageAltText
[title] =>
[width] => 150
[height] => 150
[uid] => 29
[filename] => myimagename.jpg
[uri] => public://myimagename.jpg
[filemime] => image/jpeg
[filesize] => 8812
[status] => 1
[timestamp] => 1339445372
[uuid] => a088ea8f-ddf9-47d1-b013-19c8f8cada07
[metatags] => Array
(
)
)

So I *could* display the image using an (ugly) hand rolled functions that takes the value found in `$item['#options']['entity']->field_image` and does the substitution of `public://` for the actual server path, and then it's also possible that I'm going to want to load the image with the correct drupal image style (thumbnail, custom-style, etc...)

Sadly, I just have no idea what the name of the function that works something like: `unknown_function_name_drupal_image_print($item['#options']['entity']->field_image, 'thumnail');` is.

Is there anyone who can help me find this?
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through