0

Hi I have news content type, where are fields Title(textbox), Body(text with CKeditor) and Summary Image(multimedia asset). Is it possible to auto add first image from Body to summary image field?

1 Answer 1

0

Install the Token Filter module. That'll tell you what tokens available and from them choose the field that you want to display in the node body. So when you save the node the token will replace with the field value you want.

4
  • no, you didn't understand me. I have summary image(multimedia asset) where I can choose image and it will be shown on listing news page. I just want to have possibility to show first image from content on listing news page, when no summary image was chosen.
    – Frees
    Jul 5, 2013 at 15:06
  • You mean show a default image? when no image is attached with the summary.
    – heshanlk
    Jul 5, 2013 at 15:10
  • exactly, but this default image will be chosen automatically from news body(which is created via CKeditor).
    – Frees
    Jul 5, 2013 at 15:11
  • Create a tpl file for that content type and place it in your theme folder, node--CONTENTYYPE.tpl and check for your field value in tpl file. $node->field_SUMMARY will give you the associative array of the field. If that's empty print your default image there.
    – heshanlk
    Jul 5, 2013 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.