Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I am overriding the node edit form by panels. Normally each field of a content type has a form item on panels' node form tab.
For a flag, if I check: "Display checkbox on node edit form", it shows on normal node edit form. But I cannot find an item to put this checkbox on the panel overriden node form.
Please see the attached image. There should be an item for flag in the shown list.
Comment | File | Size | Author |
---|---|---|---|
#1 | Flag-link.PNG | 13.6 KB | Sinovchi |
panel_form.png | 39.91 KB | Sinan Erdem |
Comments
Comment #1
Sinovchi CreditAttribution: Sinovchi commentedLook in the Entity tab:
Comment #2
joachim CreditAttribution: joachim commentedDoes that mean this feature is already available?
Comment #3
Sinan Erdem CreditAttribution: Sinan Erdem commented@biarr: are you sure it is the form item (checkbox), not the output of flag?
Comment #4
Sinovchi CreditAttribution: Sinovchi commented@Sinan Erdem
You are right. It was an output of the flag, sorry for misleading.
Comment #5
Renee S CreditAttribution: Renee S commentedThe flag will show up in the "base form" output, but you can't separate it out.
Comment #6
PhilYOK, adding the "Flag for node" content allows to flag an existing node in edition mode (node/*/edit).
What about creating a new one?
Without Panels, you can flag the content you're are creating (in node/add form) but with Panels, the "Flag for node" triggers an error:
Is there another panel content to use for node/add/page variant?
Comment #7
NWOM CreditAttribution: NWOM commentedI'm glad I ran across this issue. It appears that since the Flag checkbox is not available as a pane within "Form Content" that the initial value cannot be set. Anyone found a workaround in the meantime?
Edit: I found a workaround using the Rules module, if you need the value to always be set.
First, you have to disable "Display checkbox on node edit form" and then add a rule "After saving new content of type" with the action "Flag a Node". This way, whenever a new node is created, the current logged in user will automatically subscribe to it.
I hope this helps others looking for the same functionality.