How to create a plugin, that overrides the landingpage

(André Karge) #1

Hi there

I want to write a plugin that overrides the landing page of my discourse-server in order to display another web-page but keeps the discourse header.
This is what I have done already:

  • created a plugin and a modified application.hbs with a new plugin-outlet and a button to test functions
  • created a simple Ember controller to handle the button click

My problem is that whenever I click on the test-button an error occurs that nothing is handled by my action.
Everything of the plugin.hbs shows up, but the function cannot be executed.
Did I forget something?
I followed this tutorial: Beginner’s Guide to Creating Discourse Plugins

This is my overridden application.hbs:

{{render "header"}}

<div id="main-outlet">
  <div class="container">
    {{#if showTop}}
      {{custom-html "top"}}
  {{render "user-card"}}

{{#if showFooter}}
  {{custom-html "footer"}}

{{render "modal"}}
{{render "topic-entrance"}}
{{render "composer"}}
{{plugin-outlet "disraptor"}}

this is the plugin hbs:

{{#if connected}}
  <h2>not connected</h2>
<div class="buttons">
  {{d-button label="" action="disraptorSwitch"}}

and this is the controller:

export default Ember.Controller.extend({
  connected: true,
  actions: {
    disraptorSwitch() {
      return false;

Thanks for any help.
Greetings, André

(André Karge) #2

Maybe this question is a little bit too fuzzy.

The point is: how do I add a route-map for my plugin for functions on the “/” route?