| Repository | GitHub - VaperinaDEV/discourse-guest-gate-theme-component: Forced login / registration popup insired by Quora · GitHub | |
| Found it useful? | > ./support --coffee | |
| Install Guide | How to install a theme or theme component | |
| New to Discourse Themes? | Beginner’s guide to using Discourse Themes |
Guest Gate v1.0
Hello
This theme component is created from Guest Gate (Sign Up Popup Plugin). It can lock topics for anon visitors with a modal and force them to Sign Up or Login. The component can be use for an alert modal, encouraging visitors to sign up but allowing them to close the modal (for this, leave the dismissable false setting unchecked). Options include changing the number of topics that can be viewed before the modal is displayed.
Tip: If you use the “custom gate” option and want to hide the modal header (as on the image above) you have to delete the
guest_gate.title field and hit a space. It will remove the modal title, so that you instead can use a title below the image.
You have two main gate options:
-
Generic gate (default: it will use the Discourse Signup CTA text in modal). It uses these texts:
js.signup_cta.introandjs.signup_cta.value_prop -
Custom gate (you can customize the modal: add image, custom text and colors).
And there are lot of other settings
Guest Gate modal global settings
max guest topic views
Number of topic views until gate displays. After the gate first appears, it appears randomly between 1 and this number.dismissable false
Removes the close button, which prevents visitors from closing it.use gate buttons
Use buttons on modal footer instead of links.custom url enabled
Enable the custom login url and custom signup url options. The normal behaviour (if you leave this option unchecked) is for the Login or Sign Up modal to appear on the current topic page.custom login url
For example, /login is the home page with the “Login” modal displayed.custom signup url
For example, /signup is the home page with the “Sign Up” modal displayed.gate footer position
Footer buttons/links position.gate show only once
Guest Gate modal show only once per session.
Custom Gate settings
custom gate enabled
Enable it if you want to customize the modal.custom gate image
Upload an image to display at the top of the modal.custom gate image width
The uploaded image width. You can use px, % etc, e.g. 100% will add a full modal width (minus padding) image.custom gate big text color
The “big text” appears below the image. You can set the color of the text.custom gate little text color
The “little text” appears below the big text. You can set the color of the text.custom gate background color
Change the modal background color.custom gate footer text color
Change the footer text color. This applies if theuse gate buttonssetting is disabled and you have set up a custom gate.custom gate link color
Change the footer link color. This applies if theuse gate buttonssetting is disabled and you have set up a custom gate.
Credit
Huge thanks to the plugin authors, maintainers and contributors: @vinothkannans, @jgujgu and @michaeld
Guest Gate v2.0
Hello ![]()
Guest Gate v2.0 is a modern, configurable gate for anonymous visitors on Discourse.
It can display a modal to encourage visitors to Sign Up or Log In, either as a soft conversion prompt or as a gate that visitors cannot dismiss.
Guest Gate started from the original Guest Gate Sign Up Popup plugin and has evolved considerably since then.
Triggering the Guest Gate
Version 2.0 supports several ways to trigger the gate:
-
Page views
Display the gate after a configurable number of eligible page views. -
Time
Display the gate after a visitor has spent a configurable amount of time on an eligible page. -
Scroll
Display the gate after a visitor has scrolled through a configurable percentage of the page. -
Lightbox
Display the gate when an anonymous visitor opens an image in the Discourse lightbox. -
Any
Enable multiple trigger types and display the gate when the first configured trigger is reached.
You can also configure a delay between the trigger and the modal appearing.
Repeat behaviour
After the Guest Gate has been displayed, you can control when it may appear again.
Available modes:
-
Repeat trigger: show the gate whenever the configured trigger fires.
-
Random page views: show the gate after a random number of page views.
-
Once per session: show the gate at most once during the browser session.
The legacy Show only once setting is also supported for backwards compatibility.
URL visibility
Two settings control where Guest Gate is allowed to appear:
url_for_show
Define the paths where Guest Gate can be triggered.
Examples:
-
*all pages -
/homepage -
/latestLatest -
/t/*topics -
/c/*categories
url_for_hide
Define paths where Guest Gate must never appear.
Hide patterns always take precedence over the show list.
Modal settings
dismissable
Allow visitors to close the Guest Gate modal.
Disable this option to create a non-dismissable gate.
gate_modal_size
Choose the modal width:
-
compact -
standard -
wide
gate_body_alignment
Choose the horizontal alignment of the main modal content:
-
left -
center -
right
gate_footer_position
Choose the alignment of the Login / Sign Up links or buttons:
-
left -
center -
right
gate_title_visibility
Show or hide the modal title.
gate_title_position
Control the title margin positioning.
Login and Sign Up
Guest Gate supports the normal Discourse authentication flow as well as custom URLs.
use_gate_buttons
Use buttons in the modal footer instead of text links.
custom_url_enabled
Use custom Login and Sign Up URLs instead of Discourse’s native authentication actions.
custom_login_url
Destination used for Login when custom URLs are enabled.
custom_signup_url
Destination used for Sign Up when custom URLs are enabled.
You can also configure the button styles and Font Awesome icons independently.
Discourse Connect
Guest Gate supports Discourse Connect.
When Discourse Connect is enabled, you can optionally provide a separate Sign Up URL using:
-
enable_discourse_connect_signup -
discourse_connect_signup_url
Custom Gate
The Custom Gate allows you to completely customize the content and appearance of the modal.
Enable it with:
custom_gate_enabled
Enable the custom gate design.
custom_gate_image
Optional image displayed above the custom text.
custom_gate_image_alt
Alternative text for the custom image.
custom_gate_image_width
Set the image width using values such as:
-
150px -
50% -
100%
custom_gate_image_position
Align the image:
-
left -
center -
right
custom_gate_big_text_position
Align the custom heading:
-
left -
center -
right
custom_gate_little_text_position
Align the custom text:
-
left -
center -
right
The custom gate also provides settings for the heading, text, background, footer and link colours.
Analytics
Guest Gate v2.0 includes optional privacy-conscious analytics.
Enable it with:
enable_analytics
When enabled, Guest Gate tracks:
-
Gate impressions
-
Trigger reason
-
Page path
-
Login clicks
-
Sign Up clicks
-
SSO actions
-
Dismiss actions
Events are exposed through window.dataLayer and are also dispatched as the browser event:
discourse-guest-gate:analytics
This allows Guest Gate to be integrated with analytics and tag-management platforms such as Google Analytics, Google Tag Manager, Matomo, or custom analytics implementations.
No personal data is collected by Guest Gate.
Analytics are disabled by default.
analytics_debug_logging
Enable this while configuring analytics to print Guest Gate events to the browser console.
It is recommended to disable this in production.
Migration from v1
Guest Gate v2.0 includes a settings migration for existing installations.
The following legacy settings are automatically migrated:
-
max_guest_topic_views -
dismissable_false -
gate_show_when_thumbnail_clicked
Existing configurations therefore do not need to be recreated manually after upgrading.
Requirements
Guest Gate v2.0 requires Discourse 3.2.0 or newer.
Credit
Huge thanks to the original plugin authors, maintainers and contributors: @vinothkannans, @jgujgu and @michaeld












