Hello, i would to know what would be the best way to achieve my need, if i’m doing things correctly, or if i can make it more simple.
With TYPO3 14.3, I want my user to be able to manage website logo, baseline, pid of footer menu, stuff like this.
My users are not administrator, so i am not able to use SiteSettings module.
I added a custom table where the user can manage those custom settings, and by using database-query, record-transformation, files, etc. i am able to use those settings in my fluid templates.
90 = database-query
90 {
as = websiteSettings
table = tx_website_settings
pidInList.data = site:rootPageId
max = 1
dataProcessing {
10 = record-transformation
20 = files
20 {
references {
fieldName = brand_operator
}
as = brandOperator
}
100 = custom-processor
}
}
Now there is some settings i want to be able to use in typoscript, to do things like this:
With SiteSettings, i would do
[traverse(site(‘configuration’), ‘settings/theme/default’) !== ‘none’]
config.htmlTag.attributes.data-scheme = {$theme.default}
[END]
Since i’m not using SiteSettings, i made an Event Listener where i listen to SiteConfigurationLoadedEvent.
Inside, i’m retrieving my record with QueryBuilder, and i’m setting configuration accordingly
eg:
$siteConfiguration[‘theme’][‘default’] = $queryResult[‘default_theme’]
$event->setConfiguration($siteConfiguration);
Then i can do in typoscript
[traverse(site(‘configuration’), ‘theme/default’) !== ‘none’]
config.htmlTag.attributes.data-scheme.data = site:theme.default
[END]
Now this is working, but am i doing things right? Could i hook somewhere else in the process, to add what i’m retrieving from database as if it was “true” site settings, so i could use them directly in typoscript?
Thanks for reading me