Giter Site home page Giter Site logo

friendsofflarum / mason Goto Github PK

View Code? Open in Web Editor NEW
20.0 3.0 14.0 1003 KB

Add custom fields to discussions

Home Page: https://discuss.flarum.org/d/7028

License: MIT License

PHP 41.51% JavaScript 54.43% Less 1.99% TypeScript 2.07%
flarum-extension flagrow mason custom-fields

mason's Introduction

Mason by FriendsOfFlarum

License Latest Stable Version

Add custom fields to your discussions. Features:

  • Create custom fields with name, icon and description
  • Fields can be required or optional
  • Fields accept a dropdown selector or user-provided answers
  • User answers can be validated with custom Laravel Validator rules
  • You can choose the number of columns of the layout
  • (experimental) show the tags field as a Mason field

Note: due to the way the Flarum discussion composer works, it currently cannot be automatically resized to fit all fields. If you have many fields you will have to manually increase the composer height with the mouse handle.

Installation

composer require fof/mason

Updating

composer require fof/mason
php flarum migrate
php flarum cache:clear

Configuration

Once enabled, a new Mason tab will show up in the admin.

Fields

Fields can be created, edited and reordered on the page. New fields are immediately visible in the frontend.

If you delete a field, it will be removed from all discussion that used it. Fields use a "soft delete" feature so the data is preserved in the database even if you delete it. You can bring the field and its answers back by editing the database if you need.

Answers

Answers are pre-made answers for a field. If you want to keep an answer visible but prevent new discussions from using it, you can change its suggestion state. If the field accepts user values, these will show up as non-suggested answers.

You can rename an answer (either admin or user made) and it will be updated everywhere it's used.

Deleting an answer will permanently remove it from all discussion using it. Unlike fields it doesn't use "soft deletes" and as such cannot be recovered.

Permissions

The extension comes with several permissions to choose who can interact with custom fields. Check the Permissions tab to configure them.

Usage

The custom fields form will display on the discussion composer, on the first post of the discussion and as an option in the discussion edit menu. The layout can be customized via the settings available in the Mason page of the admin panel.

Updating from Flagrow

This extension replaces Flagrow Mason.

Please backup your data before attempting the update!

You can upgrade from any of the older versions of the Flagrow extension.

Then upgrade from the old extension to the new one:

composer remove flagrow/mason
composer require fof/mason

When you enable the new extension, the permissions, settings and the data from Flagrow Mason will be moved to FoF Mason.

Links

An extension by FriendsOfFlarum

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.