Merge External Typoscript with Default Typoscript


/ Published in: PHP
Save to your folder(s)

This can be used if you have a Flexform field where a backend user enters Typoscript that only pertains to that single instance of the plugin, not all instances on the page.


Copy this code and paste it in your HTML
  1. $flexformTyposcript = $this->pi_getFFvalue($piFlexForm, 'myTS','s_TS_View');
  2. if($flexformTyposcript) {
  3. require_once(PATH_t3lib.'class.t3lib_tsparser.php');
  4. $tsparser = t3lib_div::makeInstance('t3lib_tsparser');
  5. // Copy conf into existing setup
  6. $tsparser->setup = $this->conf;
  7. // Parse the new Typoscript
  8. $tsparser->parse($flexformTyposcript);
  9. // Copy the resulting setup back into conf
  10. $this->conf = $tsparser->setup;
  11. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.