3

I have a views which select all not validate "event". And the purpose is to add a button to validate the "event". My hope is when I click on the button a popup ask you to confirm the validation. if yes i want to use rule to make this action. My issue is that i don't know how to begin it

1 Answer 1

2

Have a look at the Rules Link module. Some details from its project page:

This module lets you create links which trigger arbitrary functionality with the help of Rules.

Features:

  • Attach the link to any entities.
  • Show the link only for certain bundles.
  • Narrow the entities on which the link will be shown using the visibility conditions.
  • The links are usually displayed using Views.
  • For entities that can be displayed, the links can be shown on node view.
  • Supports an arbitrary number of additional Rules parameters for passing context via Views.
  • 3 types of links: Javascript, Normal and Confirmation form links.
  • Use individual permissions for each link.

Some more details (from its README.txt):

To create a new link go to admin/config/workflow/rules_links and click on "Add rules link". Enter the title of your link and set all the settings. After clicking on the "Save Rules Link" button, the module will generate a new And- and Rules-Set and their forms will be embedded into the rules link editing form.

The And-Sets are called Visibility Conditions and will define when to render the links. The Rules set is the rule, that will be triggered on clicking the rule. Additionally Rules Links also generates access permission for each link, which you'll have to set in admin/people/permissions.

The best way to display the links is currently using views. Rules Links link will create a Views field for each link, using the title of the link as title for the field. So if you have link for nodes with the delete 'Delete node', you'll find the Views field under name 'Content: Delete node'.

Alternatively you can use render the links directly in the entities that can be displayed, using the option 'Show link in entity' in the Rules Links settings.

Note that this will not work for links were the parameters have multiple paramaters.

If you would like to render a link yourself in a theme or in a module, than use the function rules_link_render_link().

PS: I'm assuming this question is about D7.

5
  • I tried it. But I have a few difficulty. First i don't understand very well the variable part. And second after save the rule, there no button that appears in my content events, in simple word I don't know how to add the button to my global text. In following the demonstration i think that the button will add automaticaly. @Pierre-vriens?
    – Z.Lass
    Commented Feb 6, 2017 at 13:43
  • Sorry @Z.Lass, but I don't quite understand your comment here: (1) which "variable part" and (2) which "demonstration"? Also, be aware that "Rules link" does NOT itself add such button. Instead you should add an extra column to your views result, which is an hyperlink to somewhere (and which you may theme as you want if you want it to be a real button). And then, when anybody clicks such link (for a specific row of your views result), then that will trigger the rule (in which you can include what you called "... to make this action"). Get it? Commented Feb 6, 2017 at 14:22
  • Thank you for your answer ! ! ! For my views this is the correct answer!!
    – Z.Lass
    Commented Feb 6, 2017 at 17:46
  • @Z.Lass merci for feedback (+ accept)! See you in your next question! Commented Feb 6, 2017 at 18:01
  • @Pierre.Vriens nice find.
    – No Sssweat
    Commented Feb 7, 2017 at 4:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.