0

What I am trying to achieve:

I want the unique banner image for each node and the views page, where the site administrator can simply upload the image and description to upload the banner for each node.

What I have done so far:

I have created the custom paragraph (https://www.drupal.org/project/paragraphs type) with image and description field and attached it to the content type.

Then I have hidden the paragraph field from manage display and then I installed field as block module(https://www.drupal.org/project/fieldblock) to display my attached field, particularly attached with the node from block layout in the custom banner region.

Problem: With this approach I successfully created a unique banner for content type; however, I am not sure how to achieve this in views page. Any other approach I could achieve this?

2

I'd suggest to use core's Custom content blocks to create blocks (similar to your banner paragraph for nodes). Then you've got two options:

You can either use Block Layout to place the blocks, but limit visibility of the block to certain pages/URLs. Pro: You can directly place the block in any region. Con: It will clutter up your Block layout page if you've got a lot of views.

Or you can go to Views UI and place the block in the header of the view (middle column, below Page settings). Pro: Block and View are tied together in the same part of the Admin UI, no clutter in Block Layout. Con:The block will not be placed in your banner region

  • Hmm...thanks for the quick response.. any other ways since using block layout would clutter up as you said when I have multiple views, and I guess I might need to create multiple blocks to create a unique banner which would be impractical in a long run. Any other approach? – dejavu May 22 at 0:48

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.