• Resources
  • Free Flarum hosting on an expert platform by FreeFlarum.com

I just had an error with the custom CSS, telling me the custum CSS can't have more than 65,000 characters.

Is this limitation really necessary? While I have done most of the modification needed for my forum, I may have to add some more for details, and here I'm totally stuck (apart from adding a <style> in the header for future updates, but it's not very clean...)

    TB54 that's a limitation from Flarum's side and/or MySQL. I guess noone really expects you to have a CSS longer than 65k characters. The "Custom CSS" in appearance is intended for small tweaks to the forum appearance. In your case, putting the CSS in a file and loading that might be a better option.

    FreeFlarum doesn't support uploading files to webroot, but I think that it would be possible to upload it externally and use the HTML Head Items extension to load the file externally via <link rel="stylesheet" src="https://..."/>.

    • TB54 replied to this.

      SKevo FreeFlarum doesn't support uploading files to webroot, but I think that it would be possible to upload it externally and use the HTML Head Items extension to load the file externally via <link rel="stylesheet" src="https://..."/>.

      Mmm yes indeed, good idea, it would work. But if for some reason the server with the file has a temporary problem, it will make a very weird result.

      Is there a reason for the limitation (apart from the fact you didn't expect that much customization)? It could be too heavy for freeflarum?

        TB54 Is there a reason for the limitation (apart from the fact you didn't expect that much customization)? It could be too heavy for freeflarum?

        I don't know, as we have no control over this limit. Flarum (devs) likely set the max length of the key in database to 65k for the CSS field, probably because it's not common that forums will have huge CSS, and I can imagine that there would be a problem when it comes to validating the CSS before saving it, as longer CSS takes more time to process.

        The custom CSS is stored in the Flarum settings key-value table, which has the same maximum size for all settings values. I'm not sure why this value was chosen originally (it can technically be set higher), but it sounds like a reasonable choice for regular settings which are mostly simple text fields.

        Extension developers are expected to create their own tables or a different system entirely to store settings that require more storage space. The Flarum custom CSS field is designed for simple customization but it's expected that a (theme) extension be used/created for more advanced customization. Including CSS files from the root extend.php is usually the best solution for advanced local themes, but unfortunately this can't be used here.

        Sorry, this will be a total newbie question, and maybe not linked at all to freeflarum: someone signal me that my forum is blocked as his university (which is a problem, as it target first university teachers and students), while a lot of things are permitted there (including reddit). He said the university forbids imgur (I have the imgur upload extension), but as it is used on reddit i doubt it's the reason.

        I have no idea what are the rules to decide what automatically blocks or not a website in companies or universities, and I try to find the reason, but don't know where to start. Any possibility it would be linked to the server used by freeflarum ?

          TB54 Any possibility it would be linked to the server used by freeflarum ?

          Perhaps? Obviously, I don't know what filters they use, and so I can't really help you with this, sorry. It's something that the university will have to look into.

          Ok, that was just to know if you had similar issues... Now I wonder if it's not related to keywords for SEO (there is "cinema" among then) or keyword for freeflarum. I will try to find how those blocking work in general.

          Maybe I am just blind but how can I follow the entire forum for new content?

            orschiro you can't. People have requested extensions that can do this in the past, but that would generate too much E-mails (this limitation is back from when we were using Mailgun).

            We will look into potentially allowing this in the future, but first we need to ensure that all these E-mails won't be marked as spam.

              SKevo Understood, thanks! And is there a way to generate an RSS feed for any new topics?

              Then I can subscribe myself via Blogtrottr.

                4 days later

                All forums are currently being upgraded to Flarum 1.3.0. Syncing them is necessary, in order for them to become fully operational. You can either wait or sync them manually in the FreeFlarum settings page. If everything goes well, recently requested extensions will be installed too

                  SKevo You can either wait or sync them manually in the FreeFlarum settings page.

                  Is it the "fix up your forum" button? It doesn't work for me (the button doesn't open any page).

                    TB54 yes, that's a known issue. It appears as if it does nothing, but if you stay on the page for long enough, the request will eventually be processed and your forum will be synced. This will be fixed in the future

                    Alternatively, you can tell me your forum name and I'll sync it for you

                      SKevo Alternatively, you can tell me your forum name and I'll sync it for you

                      That's nice of you but there is no rush, it was just to report the problem :-)