Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added inline & popup form in events single page #323

Merged
merged 6 commits into from
Mar 22, 2024

Conversation

tfsumon
Copy link
Contributor

@tfsumon tfsumon commented Mar 11, 2024

How to add inline form shortcode in markdown

Here is the shortcode for adding form in markdown

{{< event-form event_form_testing_mode="" event_form_video_url="" event_form_redirect_url="" event_form_success_action="">}}

Options

  • Set event_form_testing_mode to true if you want to test the form locally. If this value is false, the form will not reappear after the first submission unless you open the page in a new tab or window.
  • The event_form_success_action can have values of video or redirect. If set to video, you must also set event_form_video_url. If set to redirect, you must provide a value for event_form_redirect_url.

Examples

Show video after form fill-up

{{< event-form event_form_video_url="https://www.youtube.com/embed/a3ICNMQW7Ok" event_form_success_action="video">}}

Redirect user after form fill-up

{{< event-form event_form_redirect_url="https://example.com" event_form_success_action="redirect">}}

How to add popup form

Here is the frontmatter config for adding popup form

# set it to true to enable popup form for registration
show_popup_form: true # You can test this form locally, but please note that submissions will not be sent to Netlify.

# Typically, once a user submits a form, it won't be displayed again when they revisit the page, unless they open it in a new tab or window. If you need to show the form again for testing purposes, you can set this option to true. This is particularly useful during local testing when you need to submit the form multiple times for testing purposes.
popup_form_testing_mode: false

# "video" | "content" | "redirect" # default is "content" (if you want to show a video after the form is submitted, set this to "video" and provide video url in the popup_form_video_url field. If you want to redirect to a different url, set this to "redirect" and provide a redirect url in the popup_form_redirect_url field)
popup_form_success_action: "content" 
popup_form_video_url: "https://www.youtube.com/embed/a3ICNMQW7Ok" # you can use youtube's embed url
popup_form_redirect_url: "https://example.com/" # e.g. "/thank-you"

Options

Here's an explanation of the options provided:

  1. show_popup_form:
  • This option controls the visibility of the popup form. If set to true, the popup form will be shown; otherwise, it will be hidden.
  1. popup_form_testing_mode:

    • This option controls whether the form should be displayed again after submission for testing purposes.
    • By default, once a user submits the form, it won't be displayed again when they revisit the page, unless they open it in a new tab or window. Set this option to true to show the form again for testing purposes.
  2. popup_form_success_action:

    • This option determines the action to take after the form is successfully submitted.
    • Possible values are "video", "content", or "redirect".
    • If set to "video", the form will show a video after submission, and you need to provide the video URL in the popup_form_video_url field.
    • If set to "redirect", the form will redirect to a different URL, and you need to provide the redirect URL in the popup_form_redirect_url field.
    • The default value is "content", which means no special action will be taken after form submission.
  3. popup_form_video_url:

    • If popup_form_success_action is set to "video", this field should contain the URL of the video to be displayed after form submission.
    • You can use YouTube's embed URL format for this field.
  4. popup_form_redirect_url:

    • If popup_form_success_action is set to "redirect", this field should contain the URL to which the form will redirect after submission.

Examples

Show video after form fill-up

show_popup_form: true

popup_form_testing_mode: false
popup_form_success_action: "video" 
popup_form_video_url: "https://www.youtube.com/embed/a3ICNMQW7Ok"

Redirect user after form fill-up

show_popup_form: true

popup_form_testing_mode: false
popup_form_success_action: "redirect" 
popup_form_redirect_url: "https://example.com/"

Default - show user page content after form submit

show_popup_form: true

Copy link

stackblitz bot commented Mar 11, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

Hi there 👋, @DryRunSecurity here, below is a summary of our analysis and findings.

DryRun Security Status Findings
Sensitive Functions Analyzer 0 findings
Configured Sensitive Files Analyzer 0 findings
Sensitive Files Analyzer 0 findings

Note

🟢 Risk threshold not exceeded.

Tip

Get answers to your security questions. Add a comment in this PR starting with @DryRunSecurity. For example...

@dryrunsecurity What are common security issues with web application cookies?

Powered by DryRun Security

@devopstoday11 devopstoday11 merged commit f28ef82 into intelops:chandu Mar 22, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants