Whats the Accepted Way to Load External Scripts/Style?

LabKey Support Forum (Inactive)
Whats the Accepted Way to Load External Scripts/Style? trent  2011-09-07 19:10
Status: Closed
 
i.e. just say I want a custom stylesheet.

Upload an attachment to the wiki page, look at the attachment list, disable listing attachments (for usability), and insert that link?

http://labkey-dev:8080/labkey/wiki/home/s1/download.view?entityId=abd1f051-bb02-102e-9801-323117fd92b4&name=test.css

Or... upload into the files path for the project: /usr/local/labkey/files/home/@files: test.css, and the just reference: href="/labkey/files/home/%40files/test.css"

Or... create a new folder in the labkeywebapp folder to store custom scripts e.g.:

/usr/local/labkey/labkeywebapp/custom : test.css, and then just reference: href="/labkey/custom/test.css" (which obviously requires some caution when upgrading)
 
 
Matthew Bellew responded:  2011-09-07 20:05
The third one is a bad idea, since files in the labkeyWebapp may get overwritten when you upgrade. But don't despair there are even more options:

create a directory called extraWebapp next to labkeyWebap and put the file there.

Or...

create a mini-module and put your css file in the webapp directory.

I'd recommend the /home/@files method, or if you already have a mini-module that you're installing on your servers, put it in there. There's a big advantage to having the file path not change between say development and production machines.
 
adam responded:  2011-09-07 21:02
Another option for stylesheets (but not other resources) is to simply attach one via the admin ui. You can attach different custom stylesheets to each project (project settings -> resources tab) and/or to the site as a whole (admin console -> look and feel settings -> resources tab). The stylesheet is saved in the database, making it available on dev / test / staging servers that use a snapshot of the primary database.

Adam