File management in TYPO3

Files are an essential part of TYPO3. Every day, numerous files are uploaded to TYPO3. As a web editor, the primary focus is often on building pages without paying much attention to the files being linked to. However, there is good reason to be mindful of whether there are files in TYPO3 that should be deleted.

Why file management matters

  • It is important to manage your files properly to ensure that outdated or sensitive information is not accessible online.
  • Some images may only be used for a specific period. Unauthorized use of images on our website can lead to claims for damages, according to copyright laws.
  • Files in the file folder can be found via search engines, even if they are no longer linked to.
  • Having many files makes it harder for both editors and users to find and manage the right information.
  • The website becomes slower if there are lots of unused files taking up space.

Difference between pages and files

There are several important differences between files and pages that web editors should be aware of. In TYPO3, every page has a unique ID number. This means that regardless of where a page is moved or what it is renamed, a link to the page’s ID will work as long as the page exists. This feature is highly convenient and ensures that links don’t break when pages are moved or URLs are changed.
Unfortunately, the same is not true for files.

Links to files are not as robust as links to pages

If you rename a file or move it elsewhere in the file tree, the file will get a new URL, and any links to the previous URL will result in an error, preventing users from accessing the desired file. Therefore, it’s important to be cautious when moving files around, as you risk users being unable to find them.

Files and pages are not automatically connected

This means that if you delete a page in TYPO3, the files linked to it are not automatically deleted at the same time. As an editor, you will need to delete those files manually via the file list. Similarly, when you hide a page in TYPO3, only the page is hidden. The files linked on the hidden page can still be accessed and found by search engines. Unlike pages, files in TYPO3 cannot be hidden in the same way, so when you hide a page, you should consider whether the linked files should be deleted to prevent them from remaining accessible.

How to delete linked files when deleting a page

If you want to delete/deactivate a page in TYPO3, always remember to check if there are links to files on the page first and ensure to delete any files linked to, if they are not used elsewhere.

In the example below, we want to delete a page because it is just taking up space in TYPO3 and risks confusing users who might accidentally come across it.

We can see that there is a link to a file on the page.

If we click on the link, the file will be displayed. By focusing on the URL where the file is located, we can use it to locate the file in the file list—the URL is https://typo3.au.dk/fileadmin/vejledninger/Opgaver_i_Cludo_hvis_du_har_5-10-30_minutter.pdf

From this, we can determine that the file is located under 'vejledninger' on the typo3.au.dk domain.

We can therefore easily locate the file and delete it from the file list so that it is no longer found by search engines, etc.

Select the file list in TYPO3.

If we look at the file's URL, https://typo3.au.dk/fileadmin/vejledninger/Opgaver_i_Cludo_hvis_du_har_5-10-30_minutter.pdf it can be broken down into smaller parts:

typo3.au.dk – the domain we are on

fileadmin – the root of the file repository (marked with a circle below)

Vejledninger – the file folder under fileadmin where the file is located

The last part of the URL is the name of the file - Opgaver_i_Cludo_hvis_du_har_5-10-30_minutter.pdf

We can therefore deduce that we should look for the file under the 'vejledninger' folder and navigate to it. We find the mentioned file and see that the number 2 is displayed farthest to the right, indicating that there are two links to the file in TYPO3. By clicking on the number, we can get more information about where these links are located.

Scroll down to the bottom of the pop-up window. Here, you can see all the places where the file is used in TYPO3.

We can see that the bottom link is precisely on the page we want to delete—if in doubt, you can click on the pencil icon to view the page element.

However, we also see that there is a link to the file at another location (under 'Optimize Web Content'). Therefore, we click on the pencil icon furthest to the right.

Now, we are shown the page element that contains a link to the file. In the upper right corner, you can see the name of the page where the page element is located, as well as the page's ID number. This makes it easy to locate the page if you want to view it in its entirety.

At the bottom of the text field, we can see the link to the file. This is a page that is still in use, so the conclusion is that I can safely delete the page I want to delete, but I must not delete the file it links to, as it is also linked to elsewhere.

Note

You can only access files and pages that you have permissions for in TYPO3. If you have a role that grants access to a very limited part of TYPO3, there is a risk that the above method may not work, as you may lack the rights to some of the files or pages you need to access. In such cases, you will need to contact your local TYPO3 support.

Although the file reference feature is useful and helps ensure that you do not delete files that are still in use, it is not perfect. If there is a page on another TYPO3 domain that links to the file, there is a risk that you may not see the reference even if a link exists. Additionally, links to files in TYPO3 from external sites will never be visible.

Therefore, you should always be cautious before deleting a file from the file list.

Avoid placing files in 'No Folder Selected'

TYPO3 is structured in such a way that each file list includes a general folder called 'No Folder Selected.' This folder acts as a large 'bucket' that editors across various user roles can access and place files into, making it very difficult to keep track of.

It is important never to upload any files to the 'No Folder Selected' folder, but always place your files in a specific folder within your file list.

When uploading a file through an image or text and image element, make sure to use the 'Add Image' function, which allows you to select a folder in your file list. Conversely, if you use the 'Select and Upload Files' function, the file will be automatically uploaded to 'No Folder Selected,' so avoid using that option.

Once you have selected the 'Add Image' function, you need to choose a folder. Then you can select the file you want to use if it is already uploaded in the folder. If you need to upload a new file, click the 'Select Files' button. After selecting the file you want to upload, click the 'Upload Files' button to upload it to your file folder. You can then choose the file you want to use by clicking on it.


How to keep track of your files

Managing files and file folders can be a complex task. Here are a few tips on how to approach this task and what pitfalls to avoid.

Note: This section of the guide is specifically for editors responsible for a larger site on AU's website.

1. Maintain your folder structure

If your site and file list have been around for a long time, there may have been many different administrators and editors who have created file folders and uploaded files. It may then be necessary to clean up the file list to maintain an overview and keep track of the files.

  1. Gain overview of the folder structure
    Ensure that you have a complete view of the folders and folder structure in your file list. To achieve this, it is important to use a user role that provides the broadest access to the file list, so there are no file folders you are unaware of because you cannot see them immediately. Contact your local websupoort, if you are unsure.
  2. Clean up the folders
    If you have multiple folders used to store files on the same topic, it is a good idea to clean them up. Otherwise, it can be difficult to maintain an overview of the files. Be aware that if you move a file from one folder to another in the file list, the file will receive a new URL, and any links to the previous URL will result in an error. Read more in the section on Differences between files and pages.

  3. Limit editors' user roles
    If your co-editors have access to all or a large portion of the folders in the file list, even though they do not need to use them, there is a risk that they may place files in the wrong folder. This makes it difficult to keep track of the files. Adjust the editors' user roles so that they only have access to the folders related to the pages they are responsible for.

2. Distribute the responsibility for folders

You need to know who is responsible for what, both for the pages on your website and the files in your file list. The folder structure in the file list often does not match the structure of your website unless you have been very diligent about aligning the two. Therefore, it is a good idea to keep track of who is responsible for each folder.

  1. Map out responsibility
    Create an overview of your folder structure in the file list and map out which editor is responsible for each folder.
  2. Adjust user roles
    Ensure that there is consistency between which folders in the file list your co-editors are responsible for and what they have access to with their user role.
  3. Keep information updated
    Editors are often replaced, and new ones join. Regularly update the information about who is responsible for the folders in your file list and make sure the editors are aware of their responsibilities.

3. Regularly clean up files

Over time, more and more files will accumulate in the file list. The key to managing your files is to have a regular practice of cleaning up and to establish some guidelines for the cleanup that each editor can follow.

  1. Clean up at regular intervals
    Make it a recurring task for you and your co-editors to go through the file folders and delete files that are no longer in use.
  2. Delete unused files
    TYPO3 is not an archive. If a file is not being used, you should consider whether it should be deleted. If you are in doubt about whether it will be needed again, save the file elsewhere.

    You can see if a file is being used by checking if there are any links to it. You can use the file reference function for this, which is described in the section How to delete linked files when deleting a page. However, the function is not perfect, and some files, such as logo and CSS files, must not be deleted even if there are no links to them. Therefore, you should always be cautious before deleting a file from the file list.
  3. Set rules for how long files are kept
    It can be a good idea to decide how long content, including files, should remain on the website. For example, if you upload minutes from regular meetings as PDF files, users likely do not need to access minutes from many years ago. Establish a rule, such as keeping minutes from the last 2 or 3 years on your website, with older minutes being deleted or stored elsewhere.