Skip to main content

Timeline for How to pass Block ID to a view?

Current License: CC BY-SA 4.0

10 events
when toggle format what by license comment
May 13, 2022 at 1:34 comment added liquidcms And even with that patch.. there is still no option to pass in current block id (or anything else to the view). I suspect another patch providing this part of the solution. For now I will go back to my solution of a custom argument plugin to pass in the "parent id". This does work but at the moment only grabs the first block of this type as I can't find the answer to my original question - "how to get a list of the blocks placed on a node?".
May 13, 2022 at 1:08 comment added liquidcms oddly enough i did that exact same case sensitive search across entire site and came up with nothing. But a little digging and guessing you have this patch in place: drupal.org/node/2799479. The one from #163 as I have the one from #158 which had not yet added this relationship. Thanks for the help.
May 12, 2022 at 23:55 comment added Joseph @liquidcms A quick search for "By id" (match case and words) in the code reveals that this feature is from entity_reference_revisions, a dependency of paragraphs, which you should already have.
May 12, 2022 at 22:14 comment added liquidcms Sadly no relationship anywhere near that name. Perhaps a contrib module you have? I'll see I if i can track it down. Thanks.
May 12, 2022 at 21:13 comment added Joseph @liquidcms I just checked, the relationship is named like "By id: Custom block using <paragraphfieldmachinenameonblock>". When you add the contextual filter, the field to filter is "Custom block ID". Then one minor detail I missed, when you configure the contextual filter, you check "Specify validation criteria", with validator set as "Block", and Single ID as argument. I think this last bit is what finally made the selection appear for me the last time I did this. And this was available since 9.1 without patches.
May 12, 2022 at 20:18 comment added liquidcms Tried a vanilla D9.2 site with only a couple patches to allow paragraphs to work at all with blocks in LB and i get same results as mentioned. I'll try updating to latest D9.3.
May 12, 2022 at 18:33 comment added liquidcms I'll try setting this up on a vanilla D9 site. Perhaps you have patches, or i do not have latest (I am on D9.2) or patches i do have are interfering.
May 12, 2022 at 18:31 comment added liquidcms awesome but perhaps patches required? Your description of what i have is correct. There is no relationship for "block entity type". I have relationship to the content using the fields added to that type. Using one of those i have arg for "Custom block ID". After placing block i have contextual links for "control visibility" (patch), manage attrs (styling) and configure. In configure i see only title and override title . I can also enable to ask for args in the View under block settings; but this only takes a static id in layout.
May 12, 2022 at 18:00 history edited Joseph CC BY-SA 4.0
added 8 characters in body
May 12, 2022 at 17:49 history answered Joseph CC BY-SA 4.0