Hosting dynamic pages with discourse

Is there a way to host dynamic pages with Discourse? I looked into the Landing Page Plugin, but it’s for static pages. I don’t mind having Discourse on the main domain itself instead of a subfolder, although I know I can build dynamic pages in subfolders then. Is there any alternative or a way to do this by keep Discourse in the main dir itself and adding dynamic pages to a folder?

What I mean is, I’m on the domain www.example.com, which has Discourse running on it. Can I create a separate folder on the same domain where I can host dynamic pages, like www.example.com/dynamic-folder/index.php?

Discourse doesn’t use php, so you can’t host php files with discourse.

You can do anything that php can do with a plugin, however. It’s very different than php, though.

1 Like

As i red the question is can a directory, as part of an url, be outside Discourse or Docker (docker is very difficult consept to understand for me) and therefor use PHP.

Or — can, for example, a reverse proxy redirect calls so that directory part is taken care by something like LAMP, and everything else goes to Discourse. Then it is only matter of two backends, right?

Actually I’m quite sure, in theory anyway, that could be made using Varnish. What I don’t know, among really many things, what kind of conflict will happen if/when that url is called inside Discourse. Or is it even then only matter of redirects.

2 Likes

However — that question is off topic in this category, because solution would be something else than standard.

1 Like

That’s not true, it has the Home Pages extension which allows for dynamic pages.

5 Likes

Okay, need to give it a shot then :))

Actually, I guess I should give it a try on a dummy community first to check if it works fine and doesn’t cause any issues or conflicts.

What is it that you need your interactive page to do?

It was supposed to handle some API queries mainly :))

Thanks @merefield, I have installed the plugin and will update you asap.

So these api inquiries have to do with data in discourse? Can you be more specific.

Not really, it’s more like a custom feature I’d like to add. It doesn’t have anything to do with Discourse, t’s more of a custom PHP page where I can fetch data using an API mostly intended from Crunchbase and make some processes work.

Also, is it possible to run HTML CSS JS here? Maybe using the landing page plugin itself or through some other method?

See Developing Discourse Plugins - Part 1 - Create a basic plugin Theme Developer Quick Reference Guide

2 Likes

Yeah, if you are accessing remote data, which might require API keys, do that in a Plugin so the API keys can be kept secure and private and used only in the back-end.

Home pages is purely a front-end extension.

2 Likes

Yes, that’s the reason I was actually asking if we can add a folder to keep the key safe in a .env file. Also, I tested the plugin, it works great thank you! :))

1 Like