1

I have created an inquiry form using the Webform module. I displayed it using block by enabling Available as block (Form Settings -> Advanced Settings) which is working fine and the form submitted by all (Anonymous, Authenticated user).

I want to add a visibility that if a user has already filled the form, the form should not be visible to that user until the site is close.

1
  • What do you mean by "the form should not be visible to that user until the site is close."? Do you mean until the user logs out of the site, or the user navigates away from the website or something else?
    – rooby
    May 31, 2016 at 8:04

1 Answer 1

2

Have a look at the Rules block visibility module. Here is a quote from its project page:

The Rules block visibility module allows Rules components to be used to control block visibility. This provides Drupal administrators and developers extreme flexibility in controlling when blocks should be displayed on their websites, in addition to the default visibility options provided by Drupal.

The general idea is that if you can do it with Rules, you can use it to control block visibility, so the possibilities are limitless:

  • Need to show a block only for users registered more than a month ago?

  • Perhaps you have a block that must be shown only between 8am-5pm on weekdays?

  • What about displaying or hiding a block based on current weather conditions?

All of this can be done by using Rules block visibility.

With that, and as per the "if you can do it with Rules, you can use it to control block visibility" above, you may have a possible solution for your question, provided you can think of an appropriate rule to be used for it. Using the Webform integration with Rules, you should be able to catch (=Rules Event) the submission of a form by a user. And combine this with some type of Rules Action so that the form is no longer visible to that user.

For an illustration of how to use this module, refer to my answer to "How to stop a Views block from displaying to admins, such as user/1?".

3
  • 1
    Interesting approach for this question. May 26, 2016 at 12:16
  • @AdrianCidAlmaguer: merci! BTW: do you have an idea what "...until the site is close" may mean? I'd like to know, since after I find out, I might enhance my answer accordingly (instead of guessing about that part ...). May 26, 2016 at 12:20
  • Maybe close the session, Il faut poser la question au OP. May 26, 2016 at 12:32

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