Header_Footer when we set a best answer after no. of maximum characters is reached it's automatically collapsed but in this extension it's showing the full answer

Although it's not necessarily the best solution you can use some CSS to set the max height that will restrict the size of the best answer.

Header_Footer maybe this extension can add schema seo tags that accepted answer tag

I believe the dedicated SEO extension has support for this, have a look and see if it covers your needs.

https://discuss.flarum.org/d/18316-flarum-seo

    ctml Although it's not necessarily the best solution you can use some CSS to set the max height that will restrict the size of the best answer.

    Hello, Ctml I tried this but its not so optimized I mean its not so smooth like discourse.

    ctml I believe the dedicated SEO extension has support for this, have a look and see if it covers your needs.

    As you said I tried that extension its amazing but do you know it mentioned that schema tag feature but in reality its not added, I checked the page source, I even cleared cache and even tried on fresh flarum install.

    • ctml replied to this.

      Header_Footer Hello, Ctml I tried this but its not so optimized I mean its not so smooth like discourse.

      There are some limitations but here is one option to limit the height and show some text like "Read the full post...". However there is no logic for shorter posts so it will still appear, but it may not matter to you. Obviously I think it could be more polished if the extension handled it all, but as far as CSS only solution I think it might be the best we can do. Screenshots for both scenarios attached.

      .item-bestAnswerPost .CommentPost{
          padding-bottom: 10px;
      }
      .item-bestAnswerPost .Post-body{
          max-height: 250px;
          margin-bottom: 10px;
      }
      .item-bestAnswerPost .CommentPost:after{
          content: "See the full post ...";
          cursor: pointer;
      }

      Header_Footer As you said I tried that extension its amazing but do you know it mentioned that schema tag feature but in reality its not added, I checked the page source, I even cleared cache and even tried on fresh flarum install.

      Ah ok sorry - my bad. Maybe you could also request that feature in the dedicated SEO extension? To be honest I am not sure which extension would be preferred to implement.

      16 days later

      oops inside the extension Disposable email , discuss link, brought me to this topic

        Braden thanks, I have fixed it on the master branch. I'm not sure if it's worth publishing a patch just for that, but it'll ship with the next update in any case 👍

        KakaLVPOT I don't think there's any weight of priority. Anyone authorized to change the best answer can do so at any time. If an admin set a best answer, the user can still choose another and it will be replaced.

        You can see some screenshots in the first post. You can scroll right in the screenshots to see more images. The best answer is shown in a green box below the OP. You can also see this in action on this very forum because the extension is enabled here.

        @IanM Hello, any possibility to get this integrated with the Gamification extension, so users can earn points also for the best answer? Thank you!

        11 days later
        • [deleted]

        Has there been a recent update to this extension ? I see version 1.1.0, but when issuing php flarum migrate the following error is displayed

        Migrated: 2021_08_09_add_qna_column_to_tags_table
        Migrated: 2021_08_10_add_reminders_column_to_tags_table
        PHP Fatal error:  Uncaught Error: Attempt to assign property "is_qna" on null in /home/metabullet/flarum/vendor/fof/best-answer/migrations/2021_08_15_migrate_reminder_settings.php:28
        Stack trace:
        #0 [internal function]: Illuminate\Filesystem\Filesystem::{closure}()
        #1 /home/metabullet/flarum/vendor/flarum/core/src/Database/Migrator.php(202): call_user_func()
        #2 /home/metabullet/flarum/vendor/flarum/core/src/Database/Migrator.php(133): Flarum\Database\Migrator->runClosureMigration()
        #3 /home/metabullet/flarum/vendor/flarum/core/src/Database/Migrator.php(116): Flarum\Database\Migrator->runUp()
        #4 /home/metabullet/flarum/vendor/flarum/core/src/Database/Migrator.php(90): Flarum\Database\Migrator->runMigrationList()
        #5 /home/metabullet/flarum/vendor/flarum/core/src/Extension/Extension.php(482): Flarum\Database\Migrator->run()
        #6 /home/metabullet/flarum/vendor/flarum/core/src/Extension/ExtensionManager.php(311): Flarum\Extension\Extension->migrate()
        #7 /home/metabullet/flarum/vendor/flarum/core/src/Database/Console/MigrateCommand.php(86): Flarum\Extension\ExtensionManager->migrate()
        #8 /home/metabullet/flarum/vendor/flarum/core/src/Database/Console/MigrateCommand.php(63): Flarum\Database\Console\MigrateCommand->upgrade()
        #9 /home/metabullet/flarum/vendor/flarum/core/src/Console/AbstractCommand.php(37): Flarum\Database\Console\MigrateCommand->fire()
        #10 /home/metabullet/flarum/vendor/symfony/console/Command/Command.php(299): Flarum\Console\AbstractCommand->execute()
        #11 /home/metabullet/flarum/vendor/symfony/console/Application.php(996): Symfony\Component\Console\Command\Command->run()
        #12 /home/metabullet/flarum/vendor/symfony/console/Application.php(295): Symfony\Component\Console\Application->doRunCommand()
        #13 /home/metabullet/flarum/vendor/symfony/console/Application.php(167): Symfony\Component\Console\Application->doRun()
        #14 /home/metabullet/flarum/vendor/flarum/core/src/Console/Server.php(42): Symfony\Component\Console\Application->run()
        #15 /home/metabullet/flarum/flarum(24): Flarum\Console\Server->listen()
        #16 {main}
          thrown in /home/metabullet/flarum/vendor/fof/best-answer/migrations/2021_08_15_migrate_reminder_settings.php on line 28

        Any thoughts ?

        Will need to roll back for the time being.

          • [deleted]

          IanM Done ! Thanks

          @"ianm"```
          #p179040 Migrating Flarum...
          Nothing to migrate.
          Migrating extension: flarum-flags
          Nothing to migrate.
          Migrating extension: flarum-approval
          Nothing to migrate.
          Migrating extension: flarum-tags
          Nothing to migrate.
          Migrating extension: flarum-suspend
          Nothing to migrate.
          Migrating extension: flarum-sticky
          Nothing to migrate.
          Migrating extension: flarum-nicknames
          Nothing to migrate.
          Migrating extension: flarum-lock
          Nothing to migrate.
          Migrating extension: flarum-markdown
          Nothing to migrate.
          Migrating extension: kyrne-websocket
          Nothing to migrate.
          Migrating extension: fof-byobu
          Nothing to migrate.
          Migrating extension: kilowhat-audit-free
          Nothing to migrate.
          Migrating extension: fof-username-request
          Nothing to migrate.
          Migrating extension: fof-upload
          Nothing to migrate.
          Migrating extension: fof-sitemap
          Nothing to migrate.
          Migrating extension: fof-pages
          Nothing to migrate.
          Migrating extension: fof-links
          Nothing to migrate.
          Migrating extension: fof-drafts
          Nothing to migrate.
          Migrating extension: michaelbelgium-discussion-views
          Nothing to migrate.
          Migrating extension: askvortsov-categories
          Nothing to migrate.
          Migrating extension: flarum-subscriptions
          Nothing to migrate.
          Migrating extension: flarum-mentions
          Nothing to migrate.
          Migrating extension: flarum-likes
          Nothing to migrate.
          Migrating extension: flarum-emoji
          Nothing to migrate.
          Migrating extension: askvortsov-moderator-warnings
          Nothing to migrate.
          Migrating extension: askvortsov-auto-moderator
          Nothing to migrate.
          Migrating extension: v17development-blog
          Nothing to migrate.
          Migrating extension: fof-best-answer

          In Macroable.php line 77:


          Method Illuminate\Support\Str::trim does not exist.

          • IanM replied to this.

            ink the 1.1.x update is not quite ready, hence it's not been announced here yet.

            That said, if you really want to check it out early, use version 1.1.2 😉

              6 days later

              Hi everyone. I found a problem when I using this extensions: I can’t set the best answer (even as an administrator). What should I do?
              My setting:
              hkMM1f.png
              hkMK9P.png
              hkMQc8.png

                360nemz if you installed the latest version, you'll have to go into the Tags admin page and pick which tags you want to designate as a question and answer tag. There should be two options in the edit and create tags modals.

                  Hi! I'm having problem enabling this extension.
                  Console Error: CR
                  Forum Log: [2021-08-26 08:40:44] flarum.ERROR: TypeError: explode(): Argument #2 ($string) must be of type string, array given in /app/vendor/fof/best-answer/migrations/2021_08_15_migrate_reminder_settings.php:25
                  Stack trace:
                  #0 /app/vendor/fof/best-answer/migrations/2021_08_15_migrate_reminder_settings.php(25): explode()
                  #1 [internal function]: Illuminate\Filesystem\Filesystem::{closure}()
                  #2 /app/vendor/flarum/core/src/Database/Migrator.php(202): call_user_func()
                  #3 /app/vendor/flarum/core/src/Database/Migrator.php(133): Flarum\Database\Migrator->runClosureMigration()
                  #4 /app/vendor/flarum/core/src/Database/Migrator.php(116): Flarum\Database\Migrator->runUp()
                  #5 /app/vendor/flarum/core/src/Database/Migrator.php(90): Flarum\Database\Migrator->runMigrationList()
                  #6 /app/vendor/flarum/core/src/Extension/Extension.php(482): Flarum\Database\Migrator->run()
                  #7 /app/vendor/flarum/core/src/Extension/ExtensionManager.php(311): Flarum\Extension\Extension->migrate()
                  #8 /app/vendor/flarum/core/src/Extension/ExtensionManager.php(182): Flarum\Extension\ExtensionManager->migrate()
                  #9 /app/vendor/flarum/core/src/Api/Controller/UpdateExtensionController.php(46): Flarum\Extension\ExtensionManager->enable()
                  #10 /app/vendor/flarum/core/src/Http/RouteHandlerFactory.php(41): Flarum\Api\Controller\UpdateExtensionController->handle()
                  #11 /app/vendor/flarum/core/src/Http/Middleware/ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}()
                  #12 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ExecuteRoute->process()
                  #13 /app/vendor/kilowhat/flarum-ext-audit-free/src/Middlewares/SetLoggerActor.php(28): Laminas\Stratigility\Next->handle()
                  #14 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Kilowhat\Audit\Middlewares\SetLoggerActor->process()
                  #15 /app/vendor/flarum/core/src/Api/Middleware/ThrottleApi.php(33): Laminas\Stratigility\Next->handle()
                  #16 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Api\Middleware\ThrottleApi->process()
                  #17 /app/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(44): Laminas\Stratigility\Next->handle()
                  #18 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\CheckCsrfToken->process()
                  #19 /app/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(67): Laminas\Stratigility\Next->handle()
                  #20 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ResolveRoute->process()
                  #21 /app/vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Laminas\Stratigility\Next->handle()
                  #22 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\SetLocale->process()
                  #23 /app/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(56): Laminas\Stratigility\Next->handle()
                  #24 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithHeader->process()
                  #25 /app/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(31): Laminas\Stratigility\Next->handle()
                  #26 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithSession->process()
                  #27 /app/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle()
                  #28 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\RememberFromCookie->process()
                  #29 /app/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle()
                  #30 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\StartSession->process()
                  #31 /app/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\Stratigility\Next->handle()
                  #32 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Api\Middleware\FakeHttpMethods->process()
                  #33 /app/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle()
                  #34 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ParseJsonBody->process()
                  #35 /app/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle()
                  #36 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\HandleErrors->process()
                  #37 /app/vendor/flarum/core/src/Http/Middleware/InjectActorReference.php(25): Laminas\Stratigility\Next->handle()
                  #38 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\InjectActorReference->process()
                  #39 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle()
                  #40 /app/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process()
                  #41 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\RequestHandler->process()
                  #42 /app/vendor/middlewares/base-path-router/src/BasePathRouter.php(101): Laminas\Stratigility\Next->handle()
                  #43 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePathRouter->process()
                  #44 /app/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(36): Laminas\Stratigility\Next->handle()
                  #45 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Laminas\Stratigility\Middleware\OriginalMessages->process()
                  #46 /app/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle()
                  #47 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePath->process()
                  #48 /app/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle()
                  #49 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ProcessIp->process()
                  #50 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle()
                  #51 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(65): Laminas\Stratigility\MiddlewarePipe->process()
                  #52 /app/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\Stratigility\MiddlewarePipe->handle()
                  #53 /app/vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
                  #54 /app/public/index.php(22): Flarum\Http\Server->listen()
                  #55 {main}
                  [2021-08-26 08:40:51] flarum.ERROR: TypeError: explode(): Argument #2 ($string) must be of type string, array given in /app/vendor/fof/best-answer/migrations/2021_08_15_migrate_reminder_settings.php:25
                  Stack trace:
                  #0 /app/vendor/fof/best-answer/migrations/2021_08_15_migrate_reminder_settings.php(25): explode()
                  #1 [internal function]: Illuminate\Filesystem\Filesystem::{closure}()
                  #2 /app/vendor/flarum/core/src/Database/Migrator.php(202): call_user_func()
                  #3 /app/vendor/flarum/core/src/Database/Migrator.php(133): Flarum\Database\Migrator->runClosureMigration()
                  #4 /app/vendor/flarum/core/src/Database/Migrator.php(116): Flarum\Database\Migrator->runUp()
                  #5 /app/vendor/flarum/core/src/Database/Migrator.php(90): Flarum\Database\Migrator->runMigrationList()
                  #6 /app/vendor/flarum/core/src/Extension/Extension.php(482): Flarum\Database\Migrator->run()
                  #7 /app/vendor/flarum/core/src/Extension/ExtensionManager.php(311): Flarum\Extension\Extension->migrate()
                  #8 /app/vendor/flarum/core/src/Extension/ExtensionManager.php(182): Flarum\Extension\ExtensionManager->migrate()
                  #9 /app/vendor/flarum/core/src/Api/Controller/UpdateExtensionController.php(46): Flarum\Extension\ExtensionManager->enable()
                  #10 /app/vendor/flarum/core/src/Http/RouteHandlerFactory.php(41): Flarum\Api\Controller\UpdateExtensionController->handle()
                  #11 /app/vendor/flarum/core/src/Http/Middleware/ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}()
                  #12 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ExecuteRoute->process()
                  #13 /app/vendor/kilowhat/flarum-ext-audit-free/src/Middlewares/SetLoggerActor.php(28): Laminas\Stratigility\Next->handle()
                  #14 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Kilowhat\Audit\Middlewares\SetLoggerActor->process()
                  #15 /app/vendor/flarum/core/src/Api/Middleware/ThrottleApi.php(33): Laminas\Stratigility\Next->handle()
                  #16 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Api\Middleware\ThrottleApi->process()
                  #17 /app/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(44): Laminas\Stratigility\Next->handle()
                  #18 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\CheckCsrfToken->process()
                  #19 /app/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(67): Laminas\Stratigility\Next->handle()
                  #20 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ResolveRoute->process()
                  #21 /app/vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Laminas\Stratigility\Next->handle()
                  #22 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\SetLocale->process()
                  #23 /app/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(56): Laminas\Stratigility\Next->handle()
                  #24 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithHeader->process()
                  #25 /app/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(31): Laminas\Stratigility\Next->handle()
                  #26 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\AuthenticateWithSession->process()
                  #27 /app/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle()
                  #28 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\RememberFromCookie->process()
                  #29 /app/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle()
                  #30 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\StartSession->process()
                  #31 /app/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\Stratigility\Next->handle()
                  #32 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Api\Middleware\FakeHttpMethods->process()
                  #33 /app/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle()
                  #34 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ParseJsonBody->process()
                  #35 /app/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle()
                  #36 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\HandleErrors->process()
                  #37 /app/vendor/flarum/core/src/Http/Middleware/InjectActorReference.php(25): Laminas\Stratigility\Next->handle()
                  #38 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\InjectActorReference->process()
                  #39 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle()
                  #40 /app/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process()
                  #41 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\RequestHandler->process()
                  #42 /app/vendor/middlewares/base-path-router/src/BasePathRouter.php(101): Laminas\Stratigility\Next->handle()
                  #43 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePathRouter->process()
                  #44 /app/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(36): Laminas\Stratigility\Next->handle()
                  #45 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Laminas\Stratigility\Middleware\OriginalMessages->process()
                  #46 /app/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle()
                  #47 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Middlewares\BasePath->process()
                  #48 /app/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle()
                  #49 /app/vendor/laminas/laminas-stratigility/src/Next.php(51): Flarum\Http\Middleware\ProcessIp->process()
                  #50 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(76): Laminas\Stratigility\Next->handle()
                  #51 /app/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(65): Laminas\Stratigility\MiddlewarePipe->process()
                  #52 /app/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\Stratigility\MiddlewarePipe->handle()
                  #53 /app/vendor/flarum/core/src/Http/Server.php(44): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
                  #54 /app/public/index.php(22): Flarum\Http\Server->listen()
                  #55 {main}

                  I'm using freeflarum and SKevo said that I should contact the author of the extension.

                    TheMarci You have an array instead of a string when migrating tables and doing explode. What's on the 25th line here?
                    /app/vendor/fof/best-answer/migrations/2021_08_15_migrate_reminder_settings.php:25