CoolCMS API

CustomAssetType : string
in package

Type of custom code (`cms_system_custom_assets.type`, varchar).

The type decides what the stored code is wrapped in on the front end:

  • css → <style>…</style> (the admin writes plain css)
  • js → <script>…</script> (the admin writes plain JavaScript)
  • html → inserted as is (a third-party snippet carrying its own tags: tag manager, pixels, chat widgets)

NOTE: html is the only type that inserts its own <script src>. For css and js the wrapping tag is generated, so it must not be typed into the code, otherwise the result is <style><style>.

Table of Contents

Cases

Css  = 'css'
Html  = 'html'
Js  = 'js'

Methods

optionKeys()  : array<string, string>
Mapping `value => translation sub-key` for select options.
translationKey()  : string
Translation sub-key (e.g. `…types.css`).

Cases

Methods

optionKeys()

Mapping `value => translation sub-key` for select options.

public static optionKeys([array<int, self>|null $only = null ]) : array<string, string>
Parameters
$only : array<int, self>|null = null

Limits the offer (null = all types).

Return values
array<string, string>

translationKey()

Translation sub-key (e.g. `…types.css`).

public translationKey() : string
Return values
string
On this page

Search results