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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.