12.5.3.3. File Templates Tab

This tab has settings that you can use to create templates for the current file.

Important

Values of the shortcodes about the files might change when they are applied to saved files.

Template

Settings under this tab have a template input in which you should enter your templates. In your templates, you can use the short codes shown at the top of the tab. In addition, you can use custom short codes you defined in Custom Short Code Selectors setting.

There are many shortcodes that are specifically defined to let you retrieve certain information about the file. The names of these shortcodes start with wcc-file-. You can hover over the buttons of these shortcodes to see what they are used for.

Important

When there are more than one template, a random one will be selected for each found item.

Each template input has a button next to it which you can use to test the template entered into that input.

Important

The test will only replace [wcc-item] shortcode and the shortcodes whose name starts with wcc-file-. Other shortcodes are not replaced in the test results. If you want to test them as well, you can use Tester Page.

Important

When you test the templates by using button, configurations under File Find-Replace Tab will be applied first.

../../../_images/options-box-file-template-test-button.png

Fig. 12.21 An example template and its test results.

An example template and its test results can be seen in Fig. 12.21. You can see that there are 4 shortcodes entered into the template input. While the original file name has 11 in it, the final local URL of the file has replaced-in-find-replace-tab instead of 11 because the find-replace options are applied first. [wcc-item] displays the originally found item, which can be seen in the test data section at the bottom of the options box.

../../../_images/wp-media-file-details.png

Fig. 12.22 Attachment details window of WordPress, which is shown when a file is clicked in Media > Library page of WordPress.

12.5.3.3.1. File name templates

Define templates for the name of the file.

Important

File extension will be added to the name automatically.

Note

Short codes in file names will be treated differently. Opening and closing brackets for the short codes will be replaced with sc123sc and cs321cs, respectively. You can write short codes regularly. This is just to inform you so that you do not get surprised when you see that opening and closing brackets of the short codes are changed in the test results.

12.5.3.3.2. Media title templates

Define templates for the title of the media that will be created for the file. This value will be set to Title input of the media item (See: Fig. 12.22). Additionally, this value will be set as the value of title attribute of the HTML element that displays the saved file.

12.5.3.3.3. Media description templates

Define templates for the description of the media that will be created for the file. This value will be set to Description input of the media item (See: Fig. 12.22).

12.5.3.3.4. Media caption templates

Define templates for the caption of the media that will be created for the file. This value will be set to Caption input of the media item (See: Fig. 12.22).

12.5.3.3.5. Media alternate text templates

Define templates for the alt text of the media that will be created for the file. This value will be set to Alternative Text input of the media item (See: Fig. 12.22). Additionally, this value will be set as the value of alt attribute of the HTML element that displays the saved file.