Asset type

From The Smartest Wiki
Jump to: navigation, search

Assets (or files) in the media library are divided into a number of different types, just as files are on other systems. Images such as JPEGs should obviously be handled differently to CSS files, Rich text files, templates, or binary files such as ZIP files.

Each file type is identified with a different asset type code. All asset type codes take the form SM_ASSETTYPE_*. Some examples of these are: SM_ASSETTYPE_RICH_TEXT for rich text files, and SM_ASSETTYPE_PNG_IMAGE for PNGs. A Yaml file (System/Core/Types/assettypes.yml) contains details information about how each asset type should behave.

All file types are also assigned to a file category, so JPEG images have a file type of SM_ASSETTYPE_JPEG_IMAGE and are in the category 'image'. There are currently six categories in Smartest's Media Library.

All asset type codes are as follows, grouped by category:

  • user_text
    • SM_ASSETTYPE_RICH_TEXT
    • SM_ASSETTYPE_TEXTILE_TEXT
    • SM_ASSETTYPE_PLAIN_TEXT
    • SM_ASSETTYPE_HTML_FRAGMENT
  • image
    • SM_ASSETTYPE_JPEG_IMAGE
    • SM_ASSETTYPE_PNG_IMAGE
    • SM_ASSETTYPE_GIF_IMAGE
    • SM_ASSETTYPE_INSTAGRAM_IMAGE
    • SM_ASSETTYPE_SVG_IMAGE
  • browser_instructions
    • SM_ASSETTYPE_JAVASCRIPT
    • SM_ASSETTYPE_STYLESHEET
    • SM_ASSETTYPE_WEB_OPEN_FONT_FORMAT
    • SM_ASSETTYPE_EOT_FONT_FORMAT
    • SM_ASSETTYPE_CUFON_FONT
  • embedded
    • SM_ASSETTYPE_MP3
    • SM_ASSETTYPE_OGG_VORBIS
    • SM_ASSETTYPE_YOUTUBE_CLIP
    • SM_ASSETTYPE_VIMEO_CLIP
    • SM_ASSETTYPE_MPEG_MOVIE
    • SM_ASSETTYPE_QUICKTIME_MOVIE
    • SM_ASSETTYPE_FLASH_VIDEO
    • SM_ASSETTYPE_SHOCKWAVE_FLASH
    • SM_ASSETTYPE_WMV
  • other
    • SM_ASSETTYPE_PDF
    • SM_ASSETTYPE_ARCHIVE
    • SM_ASSETTYPE_MS_WORD
    • SM_ASSETTYPE_MS_EXCEL
    • SM_ASSETTYPE_MS_POWERPOINT

Smartest's five types of template are displayed and manipulated separately in the Templates application, but they are stored in the same system used by the media library, and have the following asset type codes:

  • templates
    • SM_ASSETTYPE_CONTAINER_TEMPLATE
    • SM_ASSETTYPE_MASTER_TEMPLATE
    • SM_ASSETTYPE_ITEMSPACE_TEMPLATE
    • SM_ASSETTYPE_COMPOUND_LIST_TEMPLATE
    • SM_ASSETTYPE_SINGLE_ITEM_TEMPLATE