intelops / website

This is the repo to manage all the website work, which is being developed using hugo framework.
https://intelops.ai
6 stars 21 forks source link

Added inline & popup form in events single page #323

Closed tfsumon closed 8 months ago

tfsumon commented 8 months ago

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

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.
  2. 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.
  3. 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.
  4. 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.
  5. 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
stackblitz[bot] commented 8 months ago

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

dryrunsecurity[bot] commented 8 months ago

Hi there :wave:, @dryrunsecurity here, below is a summary of our analysis and findings.

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

[!Note] :green_circle: 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