AL icon indicating copy to clipboard operation
AL copied to clipboard

[Control Add-In] Adding Files to a Control Add-In

Open LutzRose opened this issue 8 years ago • 1 comments

How can I reference files in a Control Add-In that are not of type css/js? For example, files of type "woff" or "ttf".

  • AL Extension Version: 0.16.16948
  • Server Version:

LutzRose avatar Jul 02 '18 21:07 LutzRose

Hi @LutzRose,

While control add-ins do not have a designated property for additional files to include, you can piggyback on the Images property to include the fonts.

For example, you can use the following setup:

controladdin MyAddIn
{
    Images = './myfont.woff';
    StyleSheets = './test.css';
}
/* test.css */
@font-face {
    font-family: "myfont";
    src: url("./myfont.woff") format('woff');
}

The control add-in will preserve the relative file structure, so you can use relative paths in css to reference the images and fonts.

This is not the most convenient way, but at least it should work for now.

defr0std avatar Jul 04 '18 09:07 defr0std