Having a protected (Wordpress) page that only Discourse Users can access

I am interested in utilizing the Facebook Feed plugin (The Custom Facebook Feed WordPress Plugin) for Wordpress so that only Discourse users who are registered, at a certain trust level, or member of a group (whatever is easiest to implement) can access a protected page on my Wordpress installation (where a private FB group feed would be displayed using the plug-in).

Just wondering if something like this is possible?

1 Like

If the plugin posts in a Category. You should be able to do this with Category settings.

  • Security: Group Name See/reply/create
    Trust Level See/reply/create.

Del Everyone see/reply/create

I think the plug-in only works and displays on a Wordpress page or using their standalone PHP set-up:

Hmm… Not sure need some folks with stronger experience to comment.

I think there is a plugin that pulls content from other sites.

I think that the Custom Facebook Feed plugin publishes the feed using the WordPress ‘page’ post type. If this is the case, it should be possible to publish the pages created by the plugin to Discourse by adding page to the plugin’s “Post Types to Publish” setting. That setting is found on the plugin’s Publishing options tab.

If this works, you could publish the feed pages to a protected Discourse category that is configured to only allow members of a particular group to access it.

2 Likes

Hi,

I e-mailed you. Technically that worked beautifully. But the output (the FB feed itself) loses much of the formatting to make it readable and loses other features (viewing video, reading comments, etc) which I am hoping you may have a solution for.

2 Likes

It is going to be tricky to get the page content that is created by the Custom Facebook Feed plugin to be formatted correctly on Discourse. I would like to come up with a general solution to the problem that allowed complex WordPress markup to be pulled into Discourse when the “Show Full Post” button is clicked on Discourse. If this was possible, the solution would be to publish an excerpt to Discourse, instead of publishing the full post. Users would click the “Show Full Post” button to see the full post. The main issue I am finding with this is figuring out a way to allow iframes to be pulled to Discourse with the expanded post. Youtube videos are displayed in an iframe on WordPress. Videos are currently being removed from the HTML when the “Show Full Post” button is clicked.

With the current Discourse functionality, I am not sure what the best approach for you would be. One possibility would be to publish your Facebook group posts to Discourse via Zapier. There is a guide for setting this up here: Using the Zapier Discourse Zap Templates. The Zapier template for publishing Facebook Group posts to Discourse is found here: https://zapier.com/apps/discourse/integrations/facebook-groups.

1 Like

How would Zapier to Discourse handle constantly added comments, reactions, and/or edits to a post in the FB group?

And what about the archive of past posts on the FB group vs new ones that are triggered?

Thanks.

The Discourse + Facebook Groups integration would only handle new posts created on your Facebook page. It would not create topics for old Facebook posts, or handle comments, reactions or edits to posts.

That’s a shame. So it sounds like this is not something that is going to be easy to do unless Discourse could somehow just create a feature that allows the rendering of a plain HTML page (in which case the stand-alone PHP product for this particular product)?

It’s not elegant, but you can use an iframe to embed the WordPress page within the Discourse page. Just be sure that the page in question isn’t dressed up with any navigation, header or footer.

iframes are truly terrible, this is one of the few remaining use cases where they make any sense.

2 Likes

Would you be able to tell me how to use the iFrame solution to embed the Wordpress page within the Discourse page? I am out of options so it seems the last chance to get this working. Thank you!

I just put up a marketplace ad for the following projects which I copy & paste for you below. Does this look like something that is technically feasable in an elegant way to accomplish?


I am looking for help with two projects.

The first:

  1. When a user registers on Discourse with their FB account, check if they are a member of a certain closed FB group (that I am an admin of)
  2. If the user is a member of that FB group, then assign them to a specific Discourse user group (which gives them access to a private category only for group members)
  3. If the user is NOT a member of that FB group, then register them normally into Trust Level 0 with no groups assigned

The second project:

Is there any way to render a Wordpress page (which contains a complex FB feed) ONLY to Discourse members who are a part of the group describe in #2 above?

Thank you!

If Facebook will allow you to access a user’s group membership status, the first project should be possible. You’ll need to assign users to the Discourse group through the Discourse API. The API calls could be made from your WordPress site. Group memberships could also be assigned with a Discourse plugin, but that plugin would not be able to be installed on our hosting.

The second project could be accomplished by customizing the WP Discourse publish_format_html template so that it handles your Facebook feed page differently than it handles other posts that are published to Discourse from your site.

1 Like