Hello

I am trying to realize a tab element with a bricks layout using the paragraphs approach. I dont use the boostrap addon modules for that.
So my setup in the content looks like this:

Field Bricks (revisioned) > Paragraph Layout (Tab) > Paragraph Layout (Tab Item) > Paragraph Text

While building the markup i need the title (Layout paragraph field_title) from the nested Tab Item Layout paragraphs during the preprocess_layout of the Tab paragraph to build the tab header.
But i cannot see a way to get the paragraph, that belongs to that layout. So i mean the reference to the paragraph, that is responsible for that layout.

In Version 1.6 the paragraph itself gets also rendered, so i had the possibility to do the tab header logic in the preprocess_paragraph__layout itself.

How could this be done in the dev version? Or how would you build such a tab element with bricks layouts?

My easy fix would be changing the logic in _bricks_nest_items() to preserve not only the #label and #attributes key, but also the #paragraph key if it exists. So then we would have the possibility to access specific fields of a paragraph if needed.

I don't know if this is a good idea or not, but for m,e that works and i don't see any problems happening after that.

I will provide a patch, so hopefully one could give some input on that.

Thanks, Jan

Comments

megadesk3000 created an issue. See original summary.

megadesk3000’s picture

StatusFileSize
new675 bytes
megadesk3000’s picture

Issue summary: View changes
megadesk3000’s picture

Status: Active » Needs review
keshavv’s picture

Status: Needs review » Reviewed & tested by the community

Working perfect

rjjakes’s picture

Version: 8.x-1.x-dev » 2.x-dev

  • rjjakes committed 4bbcc00 on 2.x authored by megadesk3000
    Issue #2992935 by megadesk3000, keshav.k: Get belonging paragraph during...
rjjakes’s picture

Status: Reviewed & tested by the community » Fixed

Merged into 2.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.