Is there an action to reload the page on rule evaluation? Like if X happens, reload page? Would adding in javascript and doing some window.reload() work if I execute custom php? I know this is a general question I'm just trying to engineer something and trying to determine if that would be a good route.

Thanks!

Comments

betoaveiga’s picture

Component: Rules Core » Rules Engine

Some events work after the page loads, like "Comment is published". The event you are looking for must work before the page loads, like "Content is going to be viewed", after setting your own conditions you must add an action like "Add PHP code" and there you must add your action, javascript with the drupal_add_js function or add a PHP code to reload.

The thing is that you must understand that rules can't make changes on client, or act under some client condition, because it loads only on server (at least until now).

BTW, what are you trying to do?

Hope that helps.

gladiatorhl2’s picture

Component: Rules Engine » Rules Core
Issue summary: View changes

Hello,
I have some questions. Is there a way to reload a page after an action like ''after saving a new comment'' and how to achieve it? I haven't understood exactly why this event must work before the page loads. Could you explain that a little bit better? I think that many actions are executed after the previous action.

tr’s picture

Status: Active » Closed (outdated)