0

The content type has 4 fields - Title, Body, Image, Position Radio Button (Top, Left, Right)
Based on the selection of the position image should be placed at the respective position with the title and body
E.g. if the left is selected - > image should be on the left and the title and body should be on the right side Image depicting the above question

Is it possible to create a template override for the content type as shown in the below code snippet

{{ % if content.field_position.0 == left % }}
<div class="container">
    <div class="col-sm-6">{{ field_image }}</div>
    <div class="col-sm-6">
        <div class="col-sm-12">{{ title }}</div>
        <div class="col-sm-12">{{ body }}</div>
    </div>
</div>
{{ % endif % }}
4
  • Please rewrite this to be in the form of a question. What is the problem? What did you try, and what are you confused about? Aug 4, 2022 at 13:47
  • I have updated the question best to my ability
    – Sam Bara
    Aug 4, 2022 at 13:59
  • The position selection is a field? What kind of field is it, and how is it configured? Aug 4, 2022 at 14:01
  • It is a list field added when creating the content type it has allowed value list of top, left, and right, and can be selected during the creation of the node in that particular content type
    – Sam Bara
    Aug 4, 2022 at 14:08

0

Your Answer

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

Browse other questions tagged or ask your own question.