Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-11388

Extension CSS files are not being auto-loaded

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-dev
    • Fix Version/s: 3.1.0-a1
    • Component/s: Extensions
    • Labels:
      None

      Description

      According to the extensions RFC (https://area51.phpbb.com/phpBB/viewtopic.php?f=84&t=41499) the CSS files for the current style should be auto-loaded from the apropriate extension path. Unfortunately, this currently doesn't work althought it's vital to pretty much any extension.

        Issue Links

          Activity

          Hide
          naderman Nils Adermann added a comment -

          Can one not simply use a template hook to add the <link> tag for the extension's CSS?

          Show
          naderman Nils Adermann added a comment - Can one not simply use a template hook to add the <link> tag for the extension's CSS?
          Hide
          Marc Marc added a comment -

          Generally yes but then every extension author will probably hardcode the path and I don't think that should be the goal for this. We either should automatically load those files or provide a template variable, i.e. T_EXT_THEME_PATH, which will allow extension authors to load their CSS files via a template hook.

          Show
          Marc Marc added a comment - Generally yes but then every extension author will probably hardcode the path and I don't think that should be the goal for this. We either should automatically load those files or provide a template variable, i.e. T_EXT_THEME_PATH, which will allow extension authors to load their CSS files via a template hook.
          Hide
          MichaelC Michael Cullum added a comment - - edited

          I think Nils mis-understood the issue. Its not that it isn't being autoloaded into the html, its that it isn't being loaded as styles/<stylename>/theme/blah.css. Directly linking to ext/<vendor>/<extname>/styles/theme/all/blah.css (or whatever path inside the extension it is, I can't remember off the top of my head) simply won't work due without code due to the requirement of the 'all' or prosilver bit.

          Show
          MichaelC Michael Cullum added a comment - - edited I think Nils mis-understood the issue. Its not that it isn't being autoloaded into the html, its that it isn't being loaded as styles/<stylename>/theme/blah.css. Directly linking to ext/<vendor>/<extname>/styles/theme/all/blah.css (or whatever path inside the extension it is, I can't remember off the top of my head) simply won't work due without code due to the requirement of the 'all' or prosilver bit.
          Hide
          nickvergessen Joas Schilling added a comment -

          just like we find template files for INCLUDE we could get something like this done with INCLUDECSS

          Show
          nickvergessen Joas Schilling added a comment - just like we find template files for INCLUDE we could get something like this done with INCLUDECSS
          Hide
          EXreaction EXreaction [X] (Inactive) added a comment -

          Are we going to automatically include the CSS of extensions or not? This must be decided ASAP so it can be fixed.

          Show
          EXreaction EXreaction [X] (Inactive) added a comment - Are we going to automatically include the CSS of extensions or not? This must be decided ASAP so it can be fixed.
          Hide
          naderman Nils Adermann added a comment -

          I think any extension should add the link tag via a template hook. Furthermore I think we need a simple command that looks up if the respective file exists in that style and uses template inheritance otherwise to pick a style, and as a last resort falls back to ext/vendor/extname/assets/foo.css

          We don't currently have inheritance for regular CSS yet, but that should probably be added in time too, or if it becomes trivial to do with this command we might as well use it for the regular CSS too.

          Show
          naderman Nils Adermann added a comment - I think any extension should add the link tag via a template hook. Furthermore I think we need a simple command that looks up if the respective file exists in that style and uses template inheritance otherwise to pick a style, and as a last resort falls back to ext/vendor/extname/assets/foo.css We don't currently have inheritance for regular CSS yet, but that should probably be added in time too, or if it becomes trivial to do with this command we might as well use it for the regular CSS too.
          Hide
          EXreaction EXreaction [X] (Inactive) added a comment -

          Shouldn't it fall back to style/all/ like the templates do?

          Show
          EXreaction EXreaction [X] (Inactive) added a comment - Shouldn't it fall back to style/all/ like the templates do?
          Hide
          EXreaction EXreaction [X] (Inactive) added a comment -

          I'm planning on just making a new template token, INCLUDECSS, similar to INCLUDEJS, is that good with everyone?

          Show
          EXreaction EXreaction [X] (Inactive) added a comment - I'm planning on just making a new template token, INCLUDECSS, similar to INCLUDEJS, is that good with everyone?
          Hide
          Marc Marc added a comment -

          I'll allow it.

          Show
          Marc Marc added a comment - I'll allow it.

            People

            • Assignee:
              EXreaction EXreaction [X] (Inactive)
              Reporter:
              Marc Marc
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development