Additional menu

Get MemberPress today! Start getting paid for the content you create! Get MemberPress Now
  1. Home
  2. Knowledge Base
  3. Courses
  4. Creating Courses
  5. Using Block Widgets With MemberPress Courses

Using Block Widgets With MemberPress Courses

MemberPress Courses add-on will add course-specific widget areas to your website. You can use block widgets in these areas to add content to your MemberPress courses and lessons.

This document will provide details about available widget areas for MemberPress courses and how to use them with widget blocks.

MemberPress Courses Widget Areas

If you have the MemberPress Courses add-on active on your site with the ReadyLaunch Courses/Lessons template enabled, you will also have access to the following widget areas:

  • Classroom Sidebar – visible on all of your courses and lessons;
  • Lessons Header – visible on all of your lessons;
  • Lessons Footer – visible on all of your lessons.

Block Widgets and Memberpress Courses

MemberPress Courses are compatible with MemberPress block widgets and ones provided by WordPress or third-party providers.

Thus, you can add any block to your widget areas, and combine them to create desired designs. All widget areas will be available at Dashboard > Appearance > Widgets.

Note: If you don’t see the Widgets option at Dashboard > Appearance, please keep in mind that themes that support the Site Editor might not use widgets. In this case, you would use the Site Editor (Dashboard > Appearance > Editor) to edit your site and add MemberPress blocks to your templates and patterns.

Example: Add a Personalized Greeting and a Login Form to Your Course Sidebar

To illustrate how MemberPress block widgets could be used with courses, we created this example. Here, we’ll show you how to create a personalized greeting for logged-in members, in the sidebar of all MemberPress courses (with ReadyLaunch template enabled). Also, we’ll add a login form for the users who are logged out.

To achieve this, we will use three MemberPress block widgets:

  • Protected Content block;
  • Account Info block;
  • Login block.

As mentioned above, the Classroom Sidebar is the widget area visible on all of your courses and lessons. Thus, this is the area to which we’ll add our blocks. 

Setting Up Widget Blocks

Please follow these steps to create this setup:

  1. Log in to your site admin dashboard and navigate to Dashboard > Appearance > Widgets.
  1. Expand the Classroom Sidebar panel by clicking on the caret icon, and clicking the + icon to add the block widget.
  2. Add the MemberPress Protected Content block. Select the rule you wish to apply and choose Show under the If Allowed option. This will show any content you add to this block only to your authorized logged-in members.
  1. Next, add the default Column block and set it to 2 columns. Add the default Paragraph block and your greeting text to the left column. For our example, we used “Hello,“.
  2. In the right column, add the MemberPress Account Info block. Under the Field Slug dropdown, choose the display_name option – on the front end, this will show the display name set for the logged-in user. You can also use the first or last name slug if it fits your needs better.
  1. Next, under the Protected Content block you added previously, add the MemberPress Login block. You don’t need to add the login form to the Protected Content block, as you want the login form to be shown to logged-out users.

Note: When added, the Login block will show the “You’re already logged in.” message since you're logged in as a user. This is expected, and your logged-out users will see the login form instead.

  1. Under the Login block settings, you should leave the Login Redirect URL? option disabled, as you don’t want a user to be redirected away from your course after logging in.
  2. Click the Update button to save changes.

The Result

As a result, the logged-out users will only see the login form for your protected courses and lessons.

Once they log in, they will see the personalized greeting and the “You’re already logged in. Logout.” message.

Was this article helpful?

Related Articles

computer girl

Get MemberPress today!

Start getting paid for the content you create.