Custom Platform

Hello Discourse Community!

I’m planning to build a platform on top of a self-hosted Discourse instance that will include various custom features like a search engine, documentary resources, wikis, and more. These features are developed using HTML, CSS, and JavaScript, primarily as static pages.

My goal is to integrate these custom pages directly into the Discourse forum so that they appear as native pages rather than posts, creating a seamless user experience where they feel like an integral part of the forum. I’d like these static pages to be accessible to forum users, with all JavaScript functionalities running as intended.

Could anyone advise if this approach is possible within Discourse, or if there are specific plugins, best practices, or configurations that I should look into? Any guidance on embedding and displaying custom HTML/JS pages without making them look like posts would be greatly appreciated!

Thank you in advance for any insights!

I don’t know (you can embed though) but out of cat killing curiosity: what do you mean about static page of a dynamic app?

Well all of the features I plan to implement, like those mentioned above, is static codes, which means all of it is build through HTML, CSS and vanilla JS. I wonder if it is possible to make static page, and add the custom codes for the features mentioned onto my own Discourse instances.

Sorry to continue this, but Discourse isn’t static. It is dynamic. So are most of JS-solutions too, or PHP-based.

So, is this now question of terms? And you just want embed Discourse forum per se into a web page among everything else? You can show topics, but you will miss almost everything else functionalities of Discourse AFAIK.

2 Likes

@JstTan You may want to take a look at:

2 Likes

No, the code that I plan to implement, like the page I want to add into my Discourse forum is static page, so there wouldn’t be any server-side rendering and etc.

No, I want to add the web page, onto my Discourse forum instance. Opposite of what you saying actually.

This is quite cool, but I actually thinking of another thing, like adding and creating static page inside Discourse. The page would also needed to add custom HTML, CSS and JavaScript.

A similar question was aked eecently.
Here is an answer given:

Well, I has noticed that my question might be very confusing, so I has edited the question with the message re-generated with ChatGPT. This is the edited question:

Hello Discourse Community!

I’m planning to build a platform on top of a self-hosted Discourse instance that will include various custom features like a search engine, documentary resources, wikis, and more. These features are developed using HTML, CSS, and JavaScript, primarily as static pages.

My goal is to integrate these custom pages directly into the Discourse forum so that they appear as native pages rather than posts, creating a seamless user experience where they feel like an integral part of the forum. I’d like these static pages to be accessible to forum users, with all JavaScript functionalities running as intended.

Could anyone advise if this approach is possible within Discourse, or if there are specific plugins, best practices, or configurations that I should look into? Any guidance on embedding and displaying custom HTML/JS pages without making them look like posts would be greatly appreciated!

Thank you in advance for any insights!

Would published page be suitable for my aim through?

Those all sound like things that Discourse has already.

The easiest way to do that is to just host them somewhere else and add links to them with a theme component and have that site themed to look the same as your Discourse site. People don’t notice URLs, so if you keep the navigation on the other sites such that people can get back to Discourse, then it Just Works and nothing fancy is required.

I"m not quite sure what that means, but if you really want to add whatever your custom features are to Discourse then you’ll need to create them as plugins or theme compononents.

It’s not clear what your aim is.

2 Likes

JavaScript from where?

1 Like

that’s exactly what it does if you use the Home Pages extension of Landing Pages plugin.

see:

3 Likes

Hi,

Sorry for the late response. The features I listed is a few examples of features that I want to implement, there are around 20 of them. All of them are written with vanilla JS, HTML and CSS, without needing any server-side rendering.

I prefer to integrate it directly into Discourse, such as creating a page within Discourse, and edit the page to add all of the custom codes into it, and deploy it together with Discourse. It would be easier to maintain for me, as everything is in a single place, while my users could access the content through the Discourse forum directly without the need of leaving it. Is it possible to do this through Discourse? If possible, how?

I want to add custom features into the Discourse forum that I would host. The custom features is build directly through HTML, CSS and vanilla JS. I wonder if it is possible to do it directly, without the need of creating plugins through.

I want to implement the features code (JavaScript, HTML, CSS) directly into a single page source code, with each features having its own page.

I think the Landing Pages Plugin linked above is the closest method to what I think you are describing that is already built into Discourse.

1 Like

Another approach I use for what (I think?) you are describing here is to use a Ghost Blog/CMS for creating and hosting individual pages or posts where I want to display custom pages. Ghost is uniquely well suited for this purpose because of its flexibility for including and inserting all three (JS, CSS, and HTML) types of code on a per-page basis, and/or section/tag-specific and/or on a sitewide basis through “header code injections”, “footer code injections” and inline code/scripts inclusions right in the page/post editor.

Then you have multiple options in Discourse for how you want to embed or otherwise seamlessly include those external pages in your Discourse sites. You can then use RSS, embedded comments, Iframes, linked pages, or other methods.

I find this combination/pairing of Discourse and Ghost can provide an ideal platform for this particular use case where you need the flexibility of “on-the-fly” coding and arbitrary JavaScript injections.

Once I understood (both) the very opposite and very complementary natural strengths and limitations of each of these platforms (Ghost and Discourse) and how they can be combined and integrated, I have not found a better solution.

This way you can get the crazy-robust full content organization and community platform features of Discourse, along with the simplicity of Ghost’s on-the-fly approach to inline code editing and flexibility of including JS, CSS and HTML (and even Markdown) on individual pages.

A true bonus is that both platforms, both being open source and GitHub-based, have similarly robust, active, friendly and supportive communities where you can participate and get support and learn quickly and endlessly.

1 Like