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

Yuri created an issue. See original summary.

Yuri’s picture

Issue summary: View changes
neffets’s picture

Status: Active » Postponed (maintainer needs more info)

Hmhm?

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".

graysonecooper’s picture

I'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.

graysonecooper’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Active

Added clarification that though the issue is for 'actions' only, not for conditions.

graysonecooper’s picture

Issue tags: +rules integration
neffets’s picture

Status: Active » Postponed (maintainer needs more info)

What do you want to do with the iframe src- field in the "action" part. Rewrite?

neffets’s picture

Title: Iframe field not available in Rules as data selector » Iframe field not available in Rules Action

Question:
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

sano’s picture

Hi @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.

neffets’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

For 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]