Using Membership2 to create company-specific portals

We’re using the Membership plugin to create individual portals on our site. We’ve created memberships for Companies X, y, and Z. Each company has a single page which is protected with their membership. I have login redirection set, so when a user from Company X logs in, they end up on their protected page. But, once a user navigates away from that page, there is no easy way for them to get back to it. Ideally, I would love a way to have a button that shows up when a user is logged in. The button would be a link to their specific portal page. Thoughts about how we could make this happen?

  • Swami
    • Flash Drive

    Specifically, I was wondering if something in the add-ons would work to accomplish this. I’d like to make the button work for all the members (so we wouldn’t have to do a bunch of custom code). Could I do something like this:

    set a membership attribute to the URL of the protected page

    create a button that shows up when a user is logged in and uses the membership attribute as its destination

    Would that work? Better ideas?



  • Michael Bissett
    • Recruit

    Hey @dan, Michael here! :slight_smile:

    Have you thought about using our protection shortcodes, inside of a Text widget on the sidebar?

    With the IDs being replaced with their proper ones, something like this comes to mind:

    [ms-protect-content id="1" silent="yes"]
    //Button code to go here

    [ms-protect-content id="2" silent="yes"]
    //Button code to go here

    [ms-protect-content id="3" silent="yes"]
    //Button code to go here

    You’d want to get the ID for a membership by going to:

    Membership 2 -> Memberships

    And hovering over the “Show” link for a membership.

    As to the generation of the buttons, you could try using a plugin such as this to generate a button for each company:

    Please advise,


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.