Media Types - Adding new

From TNG_Wiki
Jump to: navigation, search

In Admin >> Media, click the Add Collection button and fill the fields as follows based on the following two examples

  a. to add a Census media type
  
     Collection ID:   census
     Display Title:   census
     Folder Name:     census 
     Icon File:       user/images/my_census.gif
     Display Order:	 << this is a new field to replace the order of the mod >>>
     Same setup as:   select new option to define new media type to behave as
                      photos, documents, headstones, histories, recordings, or videos
     
  b. to add an Scan media type
  
     Collection ID:	 scan
     Display Title:	 scan
     Folder Name:	 scans
     Icon File:	 user/images/my_scans.gif
     Display Order:	 << this is a new field to replace the order of the mod >>>
     Same setup as:   select new option to define new media type to behave as
                      photos, documents, headstones, histories, recordings, or videos

Add Collecton

Collection ID needs to be unique and in the case of a Multiple Language environment use of $text variables is used to access the variable. In the examples shown above, $text[census], $text[scan], and $text[maps] shown in the image are used.

Icon File is the location where your icon for this media collection is located. The help screen indicates is should be in the TNG folder, however as you can see it can be in a subfolder structure. In TNG V8, you must specify the TNG img folder as well if you reference a TNG icon, such as img/tng_doc.gif

Display Order is used to indicate what order to sort the items for display in the Media pull down menu.

Same Setup As is used to indicate what fields will be shown in the Media Record for an Add or Edit. The choices are the standard TNG media types of Photos, Documents, Headstones, Histories, Recordings, or Videos. In the image I only showed the first 4 types, since I have commented out Recordings and Videos as currently not used on my site.

Caution

If you previously added media types to the mediatypes.php file, you need to removed those lines before you add those media types using the Add Collection, otherwise you will have duplicates in the media menu pull down list. See Media Types - Migrating mods

Multiple Languages

In your cust_text.php, you would add the following $text variables if you are using multiple languages or want to add them as part of the topmenu.php menu entries, otherwise you can enter the value in the Display Title input field

English/cust_text.php entries

 $text[census] = "Census Images";
 $text[scan] = "Original Records";
 $text[maps] = "Historical Maps";
     

French/cust_text.php entries

 $text[census] = "Images de recensement";
 $text[scan] = "Fichiers Originaux";
 $text[maps] = "Cartes Historiques";

Note that the $text[census] = "Census Images" with a capital letter in first position will not display until you do a search

Related links

Media Overview
Setup - Media

Using Collections

Adding Media

Body Text

Thumbnails

Image Maps

Other Useful Articles

Some TNG Media Mods