Gents,

trying to use a dynamic token to feed from a submission field element the requested id node in the webform node element module, but it does not compute nor upload, using [webform_submission:values:field_key:raw].
Any suggestion?
Thank you beforehand

Comments

David Ben Arrosh created an issue. See original summary.

jrockowitz’s picture

Project: Webform » Webform Node Element
Version: 8.x-5.x-dev » 8.x-1.x-dev

The Webform Node Element does not currently support tokens but I am not exactly sure what you are trying to do. Please post some example code.

I am moving this issue to the Webform node element module's issue queue.

David Ben Arrosh’s picture

Thank you J.

David Ben Arrosh’s picture

What I am trying to do:

1. create a field in the webform,
2. this field will update the nid to be displayed by the webform node element

I am lost with this last module since no doc available, have not created any code yeat hoping answer will be straightforward or someone had gone thru the trouble already

alarcombe’s picture

Hi,

webform_node_element doesn't (yet) support tokens to define the nid to be displayed. However it _is_ possible to set the nid dynamically by subscribing to the WebformNodeElementPreRender::PRERENDER event and calling the setNid and setDisplayMode methods. This is described in the README and the webform_node_element_example module contains a working example.

Thanks,

Andrew

rodolfo_manut’s picture

good afternoon, could you explain how to subscribe the WebformNodeElementPreRender::PRERENDER event and calling the setNid

rodolfo_manut’s picture

this community was never the first because everyone here thinks they are the best and doesn't want to help those who arrive. whoever arrives again is not used to the terms used here, however intelligent you may know very well.

stephenplatz’s picture

@rodolfo_manut the explanation is pretty clear in the above post by @alarcombe

This is described in the README and the webform_node_element_example module contains a working example.

If you look at the ExampleEventSubscriber class in the webform_node_element_example module you will see that this is demonstrated.