简体   繁体   中英

Typo3: How can i set common data in header and footer like logo?

I want to set a dynamic logo for mobile and desktop versions in header footer. I want to set an email, phone number and address in the footer. how can I set all data in one place? Should I store every page of all data?

Check out Bootstrap Package ( https://extensions.typo3.org/extension/bootstrap_package/ ), a popular, ready-to-use TYPO3 extension that provides a responsive theme for TYPO3. With it, you can easily customize the header and footer across all pages. As the extension's name implies, it makes extensive use of the Bootstrap framework.

Constant is basically for a general setting, you can create in your base template. However, sitepackagebuilder provides minimal setting.

It's pretty easy: You can create your own constant with simple code below:

  1. Create constant, Add constant in your constant.ts (Generally file path is ext/yourExt/Configuration/TypoScript)

     plugin.tx_yourplugin { settings { # cat=plugin.tx_yourplugin/file; type=string; label=Website Logo siteLogo = } }

Now, you will find constant in your TYPO3 backend template->constant Editor module, within your extension constants.

  1. Assign a value to setup.ts: Add below code in your setup.ts which is located in the same directory.

     plugin.tx_yourplugin { settings { siteLogo = {$plugin.tx_yourplugin.settings.siteLogo} } }

Now, your dynamic value from constant can be accessible to your fluid template or your extbase controller. You will find your constant in the settings user below debug.

<f:debug>{_all}</f:debug>

Here is some useful link:

As far as I know, a multiline constant and type file is not yet supported.

I hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM