Hello friends, i am using View 2 module. In this i can use Fields like Node: Title, Node: Body etc. Here i want one more field like first image from the Node: Body. then to display it. Is it possible? If yes, please guide me. Thanks in advance.

Comments

rajarju’s picture

from the node body means..
you want to pull out an image from inside the BODY HTML ?
or is it a separate field ?

gmahesha’s picture

Its not a separate field. Image from the Body HTML. Since, when i create any content, in the body field i will add content and image. From that i want to extract only the image.

rajarju’s picture

i knw im late in replying :P
bt any ways..
this is usually done using a custom php field! (its a module)
which will let you write custom php and also will give you all the fields that you have added in to the view
for this case you ll have to call in the body of the node into the view, hide it, add a custom php field and use a function in a module or may be write the code there itself to sniffout image tags from the body.

I am not sure about the full context of your requirement but a better option would be to insert images as separate fields in the node
and use a Insert module and image cache to put the files inside the Editor be it any WYSIWYG
this will allow you to manipulate the files any way you want and it will be present inside drupals file table.
Cheers