1

I have create one content type[article] with two by default field i.e. title and body. In body summary part we have contain one image on left side and description on right side.

I want display the content type name on that image which is show in summary part. Please help

0

1) In FIELDS add Content Type as a field and check mark exclude from display.

2) Make sure Content Type is ABOVE Body field, other wise you will not get Content Type token as a replacement pattern.

3) Click on your Body field and in REWRITE RESULTS, checkmark override output of this field.

Then use the replacement patterns.

enter image description here

The above is for Drupal 8, in Drupal 7 it would be [type_1] [body__summary]

You can add html if you need ex: <div class="type">[type_1]</div> [body__summary]

Bonus: You could remove the image from Summary Part and instead add an image field to your content type. Then add your image as a field to your view. Then when you REWRITE RESULTS you can add the image there [type_1][field_image][body__summary]


PS: Next time tell us which Drupal version you are using!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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