Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Usually you would add an excluded contextual filter to View of type Content: Nid, and provide a default value like Content ID from URL..
I tried this on my ER View Widget display: it works in the View preview, but doesn't when the modal is opened during the node editing.
How to do this?
This seems very basic functionality: obviously you don't want to add the current entity as a reference to itself.
(Of course this will not work while creating a node)
Comment | File | Size | Author |
---|---|---|---|
#2 | custom_formalter.module.txt | 290 bytes | tfranz |
#2 | custom_formalter.info | 64 bytes | tfranz |
Comments
Comment #1
kopeboy CreditAttribution: kopeboy commentedComment #2
tfranz CreditAttribution: tfranz as a volunteer commentedYou can pass an argument to your views via a hook as described here:
https://www.drupal.org/node/1626668
Simple example:
Create a custom module with the following function:
(Tested with 7.x-2.0-rc6)
Comment #3
komlenic CreditAttribution: komlenic as a volunteer commentedThe code in #2 essentially worked for me, however, this part:
...didn't logically make sense for my application, and may not for yours either.