0

I have a content type with some custom text fields. when the node displays I'd like to show it like this:

node-title

  • field-1 (link)
  • field-2 (link)
  • field-3 (link)

field-1-content

field-2-content

field-3-content

this is for a new site, so I'd like to do that on Drupal 8 (with bootstrap theme).

0

For this requirement you should go for twig to your content type:

node--content-type.html.twig

In hook_preprocess_HOOK render all the fields you would like to show in twig file.

For better understanding of twig file follow this.

  • thanks! but could you elaborate a little on how to do that? i'm new this kind of dynamic templates and specifically to twig templates – gusans Dec 5 '16 at 12:44
  • Copy node.html.twig as node--content-type.html.twig and print the elements as per your requirement. – Ajay Reddy Dec 5 '16 at 14:09

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.