简体   繁体   中英

TYPO3 - typoscript for extension plugin

I would like to execute some typoscript commands only on page with a specific plugin on it :

page.includeCSS { }
page.includeJS { }
lib.my_bloc = COA
etc...

I move my typoscript code into the file typo3conf/ext/my_company_plugin/Configuration/TypoScript/setup.txt but it seems not to work. How to make it work ?

Furthermore, I'm not able to set a default storagepid for my module. I want all new entities to be stored in the same specific folder (uid 184 by the way) but my TS into setup.txt isn't effective and the pid in database is the page the user were on, not the 184.

#constant
module.tx_company_events.persistence.storagePid = 184

#setup
module.tx_company_events.persistence.storagePid = {$module.tx_company_events.persistence.storagePid}

If You want to add typoscript for specific page plugin then you can use typoscript condition like below.

// if get your plugin parameters then below typoscript works
[globalVar = GP:tx_extension_key|var1 > 0]
  // write your typoscript
  page.includeCSS { }
  page.includeJS { }
  lib.my_bloc = COA
[end]

// FOr specific pageId
[globalVar = TSFE:id = 10]
  page.includeCSS { }
  page.includeJS { }
  lib.my_bloc = COA
[end]

Also For StoragePid, make sure you included TypoScript from your ext in Root template.

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