Flarum Discussion Templates

License Latest Stable Version

A Flarum extension. Create per-tag templates for new discussions. This extension depends on the tags extension.

Please note that the composer is not currently available in the admin area. If you want to preview how a template with markdown/BBCode looks, I recommend typing it up in the forum discussion area and copy-pasting the contents to the discussion template textarea.

Installation

Use Bazaar or install manually with composer:

composer require askvortsov/flarum-discussion-templates

Screenshots


VIdeo In Action

A few things that weren't clear from the video:

  • Switching to a tag with a different template will only replace the content if you have not interacted at all with the composer. If you have added/deleted/etc text, the new template will not be applied
  • Templates only work with primary tags, and will only be applied if a discussion has ONLY ONE primary tag. If a discussion has a child tag, that child tag's template (if existent) will be applied, otherwise, the parent's template will be applied.

Updating

composer update askvortsov/flarum-discussion-templates

Links

    askvortsov Something went wrong, the dist file is not installed.

    [2020-05-27 03:46:11] production.ERROR: InvalidArgumentException: File not found at path: /www/wwwroot/xxxx/vendor/askvortsov/flarum-discussion-templates/js/dist/forum.js in /www/wwwroot/xxxx/vendor/flarum/core/src/Frontend/Compiler/Source/FileSource.php:27
    Stack trace:

    Awkward... Sorry about that, lemme take a look

    2 months later
    2 months later

    First of all, great extension. But it should be able to be enabled only if the "Tags" extension is enabled too. If you enable this extension without "Tags" being enabled, you brick your admin panel (the page won't fully load). In the console, the following error appears:

    The error image

    This is a problem at FreeFlarum, not sure if anyone else experienced this issue. When you enable Tags and then this extension, it works again. But it shouldn't be able to brick the admin panel. No error logs in the Flarum folder, even with debug: true in Flarum's config.

    Can you please 🙏 add option to use discussion templates also in custom discussion.
    I use 1 discussion for add project requests, Suggestions

    a month later

    Seems like a great template, but doesn't seem to be working in 0.1.0-beta.14.

    src

    2 months later