• Resolved ArielZusya

    (@arielzusya)


    I would like to be able to have some content on a page that is viewable to registered and unregistered alike and other content on the same page only viewable to certain memberships. Is there a way to do that? Thanks! I’m running LifterLMS 3.4.7.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hey @ arielzusya,

    You’re looking for our Hide Content shortcode: https://lifterlms.com/docs/shortcodes/#lifterlms_hide_content

    This will let you do this exactly!

    Take care,

    Thread Starter ArielZusya

    (@arielzusya)

    Fantastic! Thanks. Just to clarify, if I want to to hide content from unregistered users and in its place display a message, I would use the following shortcode:

    [lifterlms_hide_content membership="1234" message="This content is for members only."]
    
    This will only display to members of membership 1234
    
    [/lifterlms_hide_content]

    Also, I see that the “membership” parameter was removed. Does that mean I should use “ID” in place of “membership”? I see that “membership” still works even though it was removed. Not sure what the best practice would be. Thanks!

    • This reply was modified 7 years, 8 months ago by ArielZusya.
    Thread Starter ArielZusya

    (@arielzusya)

    Also, am I correct that I cannot embed another shortcode within this shortcode? If I am incorrect, how do I do that? I’m using the Core theme (one of the ones listed on the LifterLMS site as being compatible) and it relies heavily on shortcodes for its visual editor. Thanks!

    @arielzusya,

    From: https://lifterlms.com/docs/shortcodes/#lifterlms_hide_content

    In LifterLMS 3.1.1 the “id” and “message” parameters became available and the “membership” parameter was removed. This update is backwards compatible so the “membership” option still works.

    What does this mean? One day membership will be deprecated and will no longer work so use the ID parameter as a best practice. I guess I forgot to update the example when we added that note (just fixed that) so sorry for any confusion.

    You cannot put shortcodes inside of this shortcode, sorry about that. I’ve just recorded this in our backlog as a feature we should add (make it so the hidden content can have shortcodes in it). It’s a small addition so probably you can see that sometime in the next week or so.

    Take care,

    Thread Starter ArielZusya

    (@arielzusya)

    Thanks! That would be great. I am already so impressed with LifterLMS… I will be even more impressed if you implement that change to allow shortcodes inside this shortcode that quickly. You folks at lifter are awesome! Thanks!

    @arielzusya,

    Can you give a shortcode inside the shortcode a shot. I went to implement the “fix” this morning and it seems that it actually already works.

    It may be a conflict with a custom shortcode or something if you’re having issues but I did:

    [lifterlms_hide_content id="1234"]
    [lifterlms_courses]
    [/lifterlms_hide_content]

    And it worked just fine.

    Let me know how it goes!

    Thread Starter ArielZusya

    (@arielzusya)

    It does hide it properly from non-members but it doesn’t display it properly for members. What I get for members is the shortcode returned so when I used the example above (changing 1234 to 1997–the free membership on my site), instead of displaying courses it displays [lifterlms_courses]. Same issue with the shortcodes built into The Core theme… instead of the content that the shortcode represents that I want, it gives me the long, setting-filled, shortcode. The Core uses a variation of the Unyson visual page builder plugin for its shortcodes.

    @arielzusya,

    I’ll resurrect the issue and take a closer look later this week then and do some testing on other themes.

    Take care,

    Thread Starter ArielZusya

    (@arielzusya)

    Looks like you’ve made some progress? I just updated my plugin but no change. Is there something different that I need to be doing? Were you able to replicate the issue on your end? Thanks!

    @arielzusya,

    This was included in 3.5.1, are you on 3.5.1?

    If you are and it’s still not working can you send me a link to a page that this isn’t working on?

    Thanks,

    Thread Starter ArielZusya

    (@arielzusya)

    Turns out I wasn’t on 3.5.1… I was on 3.5.0. Updating was what the doctor (@thomasplevy) ordered. Everything is working perfectly now. Thank you!

    • This reply was modified 7 years, 8 months ago by ArielZusya.
    • This reply was modified 7 years, 8 months ago by ArielZusya.

    ??

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Is it possible to restrict part of page to members only’ is closed to new replies.