CSS/JS Files adding from Plugin

Hi Developers,
whats the best way to add custom css/js files from a plugin into RT?

From customizing doc (Customizing/Styling rt - RT 4.0.25 Documentation - Best Practical) it is recommended to

Set( @CSSFiles, (‘my-site.css’) );

But in many Extensions I find this way:

RT->AddStyleSheets(‘module.css’)

RT->AddJavaScript(“module.js”);

Called from the Extension::Module.pm

Are both working the same way? Will both ways minified?

Greetins

Torsten

K?hne + Nagel (AG & Co.) KG, Gesch?ftsleitung: Hans-Georg Brinkmann (Vors.), Dirk Blesius, Reiner Heiken, Holger Ketz (Stellv.), Jan-Hendrik K?stergarten (Stellv.), Bruno Mang, Christian Marnett?, Jens Wollesen, Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Pers?nlich haftende Gesellschaft: K?hne & Nagel A.G., Sitz: Contern/Luxemburg Gesch?ftsf?hrender Verwaltungsrat: Karl Gernandt

whats the best way to add custom css/js files from a plugin into RT?

From customizing doc ([1]Customizing/Styling rt - RT 4.0.25 Documentation - Best Practical) it
is recommended to

Set( @CSSFiles, (‘my-site.css’) );

But in many Extensions I find this way:

RT->AddStyleSheets(‘module.css’)

RT->AddJavaScript(“module.js”);

Called from the Extension::Module.pm

Are both working the same way? Will both ways minified?

Those docs should also be linking to
http://bestpractical.com/rt/docs/latest/RT.html#AddStyleSheets
which is RT->AddStyleSheets

If you’re an admin who is just adding a new css or js file, but not
writing an extension, then use @CSSFiles. If you’re writing an
extension, use the RT-> methods.

They both minify.

-kevin

Hi,

Use methods in extensions. That doc you referenced is more for admins to do
local and quick customizations.On Fri, Jun 7, 2013 at 4:52 PM, Brumm, Torsten / Kuehne + Nagel / Ham GI-ID torsten.brumm@kuehne-nagel.com wrote:

Hi Developers,

whats the best way to add custom css/js files from a plugin into RT?

From customizing doc (
Customizing/Styling rt - RT 4.0.25 Documentation - Best Practical) it is
recommended to

Set( @CSSFiles, (‘my-site.css’) );

But in many Extensions I find this way:

RT->AddStyleSheets(‘module.css’)

RT->AddJavaScript(“module.js”);

Called from the Extension::Module.pm

Are both working the same way? Will both ways minified?

Greetins

Torsten

Kühne + Nagel (AG & Co.) KG, Geschäftsleitung: Hans-Georg Brinkmann
(Vors.), Dirk Blesius, Reiner Heiken, Holger Ketz (Stellv.), Jan-Hendrik
Köstergarten (Stellv.), Bruno Mang, Christian Marnetté, Jens Wollesen,
Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878,
Persönlich haftende Gesellschaft: Kühne & Nagel A.G., Sitz:
Contern/Luxemburg Geschäftsführender Verwaltungsrat: Karl Gernandt


RT Training in Seattle, June 19-20: http://bestpractical.com/training

Best regards, Ruslan.

Thanks Ruslan & Kevin,

TorstenAm 07.06.2013 um 19:01 schrieb Ruslan Zakirov:

Hi,

Use methods in extensions. That doc you referenced is more for admins to do local and quick customizations.

On Fri, Jun 7, 2013 at 4:52 PM, Brumm, Torsten / Kuehne + Nagel / Ham GI-ID torsten.brumm@kuehne-nagel.com wrote:
Hi Developers,

whats the best way to add custom css/js files from a plugin into RT?

From customizing doc (Customizing/Styling rt - RT 4.0.25 Documentation - Best Practical) it is recommended to

Set( @CSSFiles, (‘my-site.css’) );

But in many Extensions I find this way:

RT->AddStyleSheets(‘module.css’)

RT->AddJavaScript(“module.js”);

Called from the Extension::Module.pm

Are both working the same way? Will both ways minified?

Greetins

Torsten

Kühne + Nagel (AG & Co.) KG, Geschäftsleitung: Hans-Georg Brinkmann (Vors.), Dirk Blesius, Reiner Heiken, Holger Ketz (Stellv.), Jan-Hendrik Köstergarten (Stellv.), Bruno Mang, Christian Marnetté, Jens Wollesen, Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Persönlich haftende Gesellschaft: Kühne & Nagel A.G., Sitz: Contern/Luxemburg Geschäftsführender Verwaltungsrat: Karl Gernandt


RT Training in Seattle, June 19-20: http://bestpractical.com/training


Best regards, Ruslan.


RT Training in Seattle, June 19-20: http://bestpractical.com/training