Do you have content or areas of your website that need to be gated behind a login? If so, you can accomplish this using HubSpot's Membership feature! This is available with Content Hub Pro or Enterprise, and is easily implemented within your Redwood theme-based website!
First, to learn more about HubSpot Memberships, you can check out this documentation from HubSpot.
Second, setup your membership functionality within your portal following the details in this post. This will walk you through setting up the membership list, making your content private, etc so it's ready to use.
Setup Membership System Assets
As seen in this screenshot, go to Settings -> Tools -> Content -> Private Content. This contains a lot of settings for controlling what emails are sent and what pages are displayed with everything connected to the membership process.
When you get to this settings area, first check the selected domain to apply the settings to. It will be set to "Default". This is fine if you only have one domain in your portal, but if you have multiple setup, you probably will want to change this dropdown to the actual domain your membership content is setup on.
Set your desired options on the "Basic" tab. Then go to the "Emails" tab. You'll find a series of emails that are using in membership like "Registration Invitation", "Password Confirmation", etc. You can use the default emails and can also edit them. OR, you can create your own custom emails.
Then, to to the "Pages" tab. Some of these pages have default templates that come with the Redwood theme. Those pages include: Registration page, Sign in page, Request password reset page, and the Create new password page. For these, click the selection dropdown and start typing "Redwood" to filter the options and quickly find the theme's version of this page.
For the remaining pages, select the default template, which you can "Edit" by clicking the Actions button.
Destinations
At the bottom under the "Destinations" heading, you'll see three pages to select where a user will go after they register, after they sign in, and after they sign out. You can select from any of your site pages here. Select whatever page would be most appropriate for your site.
Don't forget to SAVE your changes by clicking the button at the bottom of the page!
Enabling Membership Navigation
From any web page that you are editing (that utilizes a Redwood Industrial theme), click on the global header at the top of the page being edited. This will open the global header editor (and will prompt you that it is global content).
Click the directory tree icon on the left to open up the contents of the header as seen in the screenshot to the left. Click on "Utility Menu".
You will now be able to easily enable your membership capabilities within the top utility bar of your header.
- Toggle the "Membership Menus" field to enable usage of membership menus in your utility bar.
- Select your "Logged IN Menu" and "Logged OUT Menu". If you haven't created these yet, you can click "Create new" to setup these two navigation elements.
Logged In Menu
You can set this up however you desire, but to set it like our demo site, you will have two items:
- "\{{ contact.firstname|default("My Account") \}}". This will display the first name of the logged in user, or default to "My Account" if the name is not detected.
NOTE: Remove the \ character in both places within the above Hubl code. It shows here to block it from being active code on this page. - A "Log Out" page that links to "/_hcms/mem/logout"".
NOTE: Be sure that any pages like a "My Account" type of page are setup with Private Access so site visitors can not access the page without having logged in first.
Logged Out Menu
You can set this up however you desire, but to set it like our demo site, you will have two menu items:
- "Login" link that goes to "/_hcms/mem/login". This will trigger the login page for public site users.
- "Create Account" link that goes to a page with a form that you can tie to a dynamic list that is connected to your membership.
With both of these navigation elements setup, and then selected within your global header options, save and PUBLISH your global header.
The menu module with Redwood Industrial includes code to handle all of this, so your utility bar will display the Logged Out Menu for publish users, and then automatically swap that with the Logged In Menu after a user has logged in to your site. You do not need to modify any code within your site to implement this since you have Redwood!
There are many pieces to the setup of membership in HubSpot, and hopefully this doc and Redwood's capabilities make it easier for you... but if you still need some help, let us know!