Extracting Data from a T3D File


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

This snippet grabs the metadata from a single T3D file for display on a frontend page.


Copy this code and paste it in your HTML
  1. global $TYPO3_CONF_VARS;
  2.  
  3. require_once(t3lib_extMgm::extPath('impexp').'class.tx_impexp.php');
  4.  
  5. $import = t3lib_div::makeInstance('tx_impexp');
  6. $import->init(0,'import');
  7. $import->enableLogging = TRUE;
  8.  
  9. if (@is_file($filename) && $import->loadFile($filename,0)) {
  10. $data = $import->dat;
  11.  
  12. $title = $data['header']['meta']['title'];
  13. $description = $data['header']['meta']['description'];
  14. $notes = $data['header']['meta']['notes'];
  15. $packager_username = $data['header']['meta']['packager_username'];
  16. $packager_name = $data['header']['meta']['packager_name'];
  17. $packager_email = $data['header']['meta']['packager_email'];
  18. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.