Generate File
Description
You use this feature to generate a file into a specified directory. The file content can originate in a Content Layout (where the Navigation Object is within a Content Type), or from a Media Item in the Media Library. The Generate File Navigation Object does not create a link to the file - it only publishes the file into the appropriate directory.
This Navigation Object has many uses, for example, to create iCalendar files for event information or publish htaccess and htpasswd files.
How to create Generate File Navigation Object
To create this object, go to Assets > Navigation and click Create new navigation and select Generate File.
After completing the standard options used for all types of Navigation Objects, fill in each of the following, where relevant:
Item | Description |
---|---|
File name | The name of the file to be created, without the file extension |
Append the content ID to the name of the file | Checkbox to append the Content ID as part of the file name. By default, a comma is used to separate the File Name and Content ID. This cannot be used if the T4 Tag for this Navigation Object is being placed within a Page Layout. |
File extension | The file extension of the file, excluding the "dot" e.g. doc, csv |
Output directory |
|
Base directory | If Use alternate directory is selected above, specify the directory into which the file will be published. If the site is publishing in multiple languages, the base directory will be appended with the language code, using the channel settings for default language. |
Append the current section path to the base directory | If Use alternate directory is selected above, check this to append the Base directory with the current section path to build a structure. If left unchecked, the Base directory will always be used. |
Content layout | If the object is within a Content Layout or within a Content Item, specify the Content Layout to use for the content of the file. This layout should be added to the same Content Type in which the Navigation Object is used. This cannot be used if the T4 Tag for this Navigation Object is being placed within a Page Layout. |
Media file | If the Content layout is not used, select the Media Item to be placed within the file. If used, the Media file will get renamed on publish (as per the File Name and the File Extension above), and will publish into the directory Base directory/Append Directory specified i.e. the Media file will not publish into the normal media directory. |
Review your entries and selections, if you are satisfied with your entries, click Next to generate the object.
Once generated, highlight the T4 Tag Embed Code, copy to your clipboard (Ctrl+C) and paste into a Page Layout, or within a Content Layout or within a Content Item.