Media Content Type
- Last Modified:
- 14 Dec 2018
- User Level:
The Media Content Type is a System Content Type. Since System Content Types are used by the TERMINALFOUR system, they are pre-configured on install. The Media Library uses this Content Type when an item is added or edited.
Since the Media Content Type is used by the system to add and edit Media Library items, edits should not be made to the Content Elements. Editing this Content Type may impact on Media Library functionality.
When you add an item to the Media Library, a Media Type is selected from a drop-down list. A suitable option may be pre-selected based on the file extension of the media item, though this can be changed.
When configuring Media Types, a Media Content Layout is associated with each Media Type. This determines how the media item is presented when it is published on a page.
Modifying a Media Content Layout will modify the published version of all Media using that Content Layout.
A Media Content Layout is just a regular Content Layout that's associated with the Media Content Type. It can be edited in the same way as any other Content Layout. Each Media Type uses one or more Content Layouts. If more than one is available, a default can be selected. Alternatively, a Media T4 Tag can specify to use a particular Content Layout.
Some Media Content Layouts are pre-configured on install of TERMINALFOUR. If you have added custom Media Types, you may also have additional Content Layouts. To edit a Content Layout, select Edit on the Actions menu for the Content Layout.
As a minimum, a Content Layout for the Media Content Type needs to include a T4 Tag to output the media element (highlighted below). In this example, the Media is an image and the Description element is used to populate the alt text of the image.
<img src="<t4 type="content" name="Media" output="file" modifiers="" />" alt="<t4 type="content" name="Description" output="normal" modifiers="striptags,htmlentities" />" />
HTML attributes can be added to the Media Content Layout markup to provide more control over how a media item is published on a page. In the example above, the default alt text is populated by the Description element from the Media Library.
You could also specify a width and/or height to resize an image. Media Attributes are T4 Tags within the Media Content Layout.