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.
In Rules ,the Iframe field is not available as a data selector for actions, even if the field is included in the Rules condition 'entity has field'.
Comments
Comment #2
Yuri CreditAttribution: Yuri commentedComment #3
neffets CreditAttribution: neffets commentedHmhm?
I have a content-type "test" with a iframe-field "iframe6"
I "drush dl rules", "drush en rules_admin"
In /admin/config/workflow/rules I can create a new rule,
e.g. "Before saving content of type" then i select as type "test"
name my new rule "Test Rule Iframe" and go further.
At the manage page of this Rule /admin/config/workflow/rules/reaction/manage/rules_test_rule_iframe
I see first the event which triggers this rule: "Before saving content of type test"
And then under "Conditions" I can add "Entity has field"
Editing this condition "/admin/config/workflow/rules/reaction/manage/rules_test_rule_iframe/edit/3"
* I see first: "Data selector" You have to select "node (saved content)" with no deeper inspection
* Below at the select-field "Value" You will see now the iframe-entry "field_iframe6".
Comment #4
graysonecooper CreditAttribution: graysonecooper as a volunteer commentedI'm seeing the same issue. I tried to set the data value in Rules Action (not condition) for an Iframe field, and the data selector does not have the iframe available.
Entity has field in the Rules Condition did display the data selector for the field correctly.
Comment #5
graysonecooper CreditAttribution: graysonecooper as a volunteer commentedAdded clarification that though the issue is for 'actions' only, not for conditions.
Comment #6
graysonecooper CreditAttribution: graysonecooper as a volunteer commentedComment #7
neffets CreditAttribution: neffets commentedWhat do you want to do with the iframe src- field in the "action" part. Rewrite?
Comment #8
neffets CreditAttribution: neffets commentedQuestion:
at /admin/config/workflow/rules/reaction/manage/rules_test/add/1/action
I see a lot of actions like
"Add a variable"
or "Publish content"
WHICH action you miss, what actions You want from iframe module. I see no sense. WIll close in 2 weeks
Comment #9
sano CreditAttribution: sano commentedHi @neffets, to answer your question - when configuring the "Set a data value" action, I would expect the "Data selector" to contain an item that refers to the iframe field. Currently I do not see such option, even if I wrap the action into a condition where I test for existence of the iframe field.
My use case is:
when a node is created, I need to set the iframe URL to a specific string that contains also the ID of the node just created. Something like
/reward-widget/113457
More detail that might not be relevant:
The "reward-widget" is a form embedded via iframe field in the just-created node. I had to use iFrame because on some pages my (whole) nodes are loaded via ajax and embedding form directly into a node did not work.
Thanks for considering this functionality and your work maintaining this module.
Comment #10
neffets CreditAttribution: neffets commentedFor this target you need no rules support.
You can add token syntax to the iframe-url if you enable "tokensupport" on the admin page of iframe
Then you can use as src-uri:
* https://www.neffets.de/user/[user:uid]-[node:title]
* https://reward.example.com/?affiliate_id=[node:nid]
* https://schoene.neue.welt/insasse/[author:uid]