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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | preserve_paragraph_key-2992935-2.patch | 675 bytes | megadesk3000 |
Comments
Comment #2
megadesk3000 commentedComment #3
megadesk3000 commentedComment #4
megadesk3000 commentedComment #5
keshavv commentedWorking perfect
Comment #6
rjjakes commentedComment #8
rjjakes commentedMerged into 2.x