I want to create a section with a static image and text but with a dynamic link and place it in one content type in Drupal 8. What would be the best way to approach this? Every approach seems to have some problem.

If I try using views to make a block and use the default values to populate the static content, the default value of the text field is not shown while default image and dynamic link are displayed.

Another approach I tried is to create a custom block, override its template with static images and text but getting the dynamic links to this block is a problem as I don't know how to access the current node fields in such block.

Is there any way to make the default value of a text field that we create in our content type to be printed through a view? Or in the alternative how would I access the node fields (specifically a link field) in a custom block?

Also, any other approach will be appreciated. I have no experience of working with the .theme file and don't really know the ins and outs of that.

1 Answer 1


Found a way around - To use it as a view with some static content, create a label for a field in the view and style in template file.

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.