Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

CSS-Dateien von Erweiterungen und Plugins in den Combiner mit einbeziehen. #3161

Closed
Aybee opened this issue Nov 29, 2011 · 5 comments
Closed
Labels
Milestone

Comments

@Aybee
Copy link
Contributor

Aybee commented Nov 29, 2011

Falls es möglich ist, wäre es schön, wenn die Stylesheets aus Erweiterungen und Plugins (mediabox) auch in die generierte CSS-Datei des Frontends gepackt würden.

Ich habe gerade den Fall, dass eine Erweiterung eine einzige Regel in einer eigenen CSS-Datei mitbringt. Ich dachte ich könnte diese Datei über die dcaconfig.php und $GLOBALS['TL_CSS'] deaktivieren, gelingt mir aber nicht, obwohl ich die entsprechende Variable gelöscht bekomme.

Dann wäre es natürlich noch schön, wenn man im Layout solche Dateien aufgelistet bekäme, mit der Möglichkeit diese auch zu deaktivieren.

Related issues: #3138, #3447, #3469

--- Originally created on June 12th, 2011, at 02:50pm (ID 3161)

@Ruudt
Copy link

Ruudt commented Nov 29, 2011

Disabling those stylesheets would be nice indeed. For example: I'm using the wcslider, but I need little of it's CSS code, and added it to my own stylesheet already. But wouldn't that mean parsing all of the php code to detect CSS files. Some register would need to be created in the config.php.

--- Originally created on November 9th, 2011, at 10:56am

@leofeyer
Copy link
Member

leofeyer commented Jan 5, 2012

Der Grund, warum das noch nicht gemacht wird, ist dass die dynamischen Skripte teilweise nur auf bestimmten Unterseiten vorkommen und für diese eine komplett neue kombinierte Datei generiert würde.

  • Aufruf der Startseite -> eine große CSS-/JS-Datei mit allen statischen Skripten wird heruntergeladen
  • Aufruf einer Unterseite mit einem dynamischen Skript -> es wird nur die eine kleine zusätzliche CSS-/JS-Datei heruntergeladen und die große kombinierte aus dem Cache verwendet.

Die einzige Ausnahme sind die CSS-Dateien, die in den "moo_"-Templates aus dem Seitenlayout geladen werden. Diese könnte man als statisch betrachten.

@Ruudt
Copy link

Ruudt commented Jan 5, 2012

Can we not have a place they can be registered by the extension and enabled/disabled by the user?

So I'm opting for a central system that can be set per layout, similar to the modules selection. It will include contao generated stylesheets and stylesheets registered by extensions. You would be able to select if they are available to the layout, but also if they must be loaded for all pages, or only when the extension is loaded. The first option includes the stylesheet in the combiner, for all pages. The second option doesn't but includes the stylesheet whenever the a module requests it.

This enables me to NOT include a stylesheet without changing an extension, to include the stylesheet in the big combined css file or to use the current behavior.

leofeyer added a commit that referenced this issue Jan 5, 2012
@leofeyer
Copy link
Member

leofeyer commented Jan 5, 2012

Ich habe eine Lösung, die beides erlaubt, in 7ea27a0 implementiert.

@leofeyer leofeyer closed this as completed Jan 5, 2012
@tristanlins
Copy link
Contributor

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants