Hi everyone,
I’m setting up a new Typo3 website using Typo3 v13.4.
It’s not my first time working with Typo3, but I’m far from knowing the in and outs, and it is the first time I’m working with a Composer based sitepackage and the newly introduced site sets.
I have created a blank sitepackage using the official Typo3 sitepackage builder and installed it using Composer. I have also set up a site set inside of the sitepackage extension and was able to select it in the site configuration.
In the page.typoscript at packages/mytheme/Configuration/Sets/SitePackage/TypoScript I have included a CSS file from the public resources folder. The setup.typoscript one level above imports ./TypoScript/, so that should load the page.typoscript.
When I check the TypoScript in Typo3 at Site Management > Typoscript, I see my set as well as the Main TypoScript Rendering listed for this site.
But whenever I check the output of one of the pages, the CSS is nowhere to be found.
So all in all, I am a bit confused and not sure what’s getting loaded. I have been browsing the docs, but it didn’t make me any wiser.
If someone could explain to me how exactly sets get loaded (what files are automatically loaded, what do I need to reference manually and where?) and how I could check what’s actually being loaded right now or how to find out why my page.typoscript seems to not be loaded on the website, that would help me a lot. I’m also a bit confused about the relationship between the site set and the Main TypoScript Rendering. Do I have to change the Main TypoScript Rendering when I use a site set or does it replace it? If yes, what do I have to change it to? The default description says "all TypoScript should be extracted into external files via @import ‘EXT:site_myproject/Configuration/TypoScript/setup.typoscript’', I tried manually importing things here, which didn’t solve my problem either. I also wasn’t sure if that’s the “correct” way with site sets, as I understood site sets as an alternative way to handling this.
Thank you in advance for any explanations or advice on what I should do or check next.
TypoScript to include CSS or JS files (I think you mean that includeCSS) should be placed in setup.typoscript file and not in the page.typoscript file.
You should not mix page.typoscript and setup.typoscript files. They are for different purposes. MAybe this page helps to understand the differences: Introduction into TypoScript — TypoScript Explained 13.4 documentation
I hope that helps. If not feel free to ask again. It’s also possible to use slack for your questions. If you have simple short question to one topic, it’s possible to get quick answers there.
Hi Karsten,
Thank you for your input. I was also used to this configuration being in the setup.typoscript, however, it was set up this way by the official sitepackage builder (Kickstart your TYPO3 template development - get.typo3.org).
It has created the following structure: Configuration/Sets/SitePackage/setup.typoscript:
@import './TypoScript/' (That’s the whole file)
Configuration/Sets/SitePackage/TypoScript contains two files, page.typoscript and config.typoscript
The page.typoscript contained the typical page object definition, as I have seen it before in other typo3 projects. It als had the includeCss {} by default, which is where I linked my CSS.
I also tried putting that configuration directly into the setup.typoscript of the site set, but that didn’t change anything. The docs say the setup.typoscript next to the config.yaml of a site set will be loaded automatically if available, but I feel like either that’s not happening or the test page I’m looking up isn’t using it.
I’m have no idea where it’s going wrong, especially since most of this is the default configuration provided by Typo3…
I have asked on Slack as well, however, if you have more ideas, I would appreciate further input as well. Thank you!
Can you put that simple code in your setup.typoscript file.
page.1 = TEXT
page.1.value = Check This!
You should find that “Check This!” in your frontend html code. If not, Something is wrong with your setup in generally. Maybe dependency to your site set is not set in the config.yaml?
Neither in the setup.typoscript, nor in the page.typoscript this changes anything. And yes, the page.typoscript starts with page = PAGE.
But I just realized something else: It seems to just use the TypoScript from the Main TypoScript rendering record, since the “Welcome to a default website made with TYPO3” text defined there does show up. So I think this changes my question to: “What does the main TypoScript Rendering have to look like so the setup.typoscript from the site set gets loaded properly?”
Currently, it looks like this:
page = PAGE
page.10 = TEXT
page.10.value (
Welcome to a default website made with TYPO3
)
page.100 = CONTENT
page.100 {
table = tt_content
select {
orderBy = sorting
where = {#colPos}=0
}
}
As mentioned, that text is showing up in the frontend, as is the heading element I have added to the page content. So how do I get Typo3 to load my site set TypoScript instead? I was assuming that it would get loaded automatically, but it seems like either something is missing or being overwritten here if I had to guess. Can you see something that’s wrong with this?
Hey @nbstern
if you use site sets and define your TypoScript there, you do not need any typoscript records in the page tree anymore. I suggest to @importall needed typoscript directly from files. Perhaps that is the problem? That you have typoscript “in records in the page tree” and same typoscript “in the new/mondern site set way”.
Regards,
Tim
It’s mostly what the sitepackage generator included, I only changed the includeCss declaration.
Any idea why it might be unable to actually find the page = PAGE definition, even though it says it has the file containing it included?
P.S. when I click on the button in the list of included typoscript files, It shows the correct file which I have included above (the page.typoscript with the page = PAGE and so on).
Update:
I just found something new that looks suspicious to me. When I check the included typoscript on the site root (with the globe icon), I see the list posted above, ending with the includes of the page.typoscript. However, when I look at the subpage, I see this:
Here, after the includes of my set, there is a template being loaded, which appears to be blank and appears to be overriding the typoscript from my site set. Where’s that coming from and how can I stop it from overriding?
Hey,
I think there is something wrong with your setup. Files, TypoScript, Imports, whatever. Please check that your site Package files follow the structure as in the documentation. And be sure your page.typoscript file is imported by the `setup.typoscript``file. It‘s important, that you don‘t have a sys_template data on the root page. And on your subpage also shouldn‘t be a sys_template data. For the First steps with the sitepackage Tutorial you don‘t need any sys_template data.