[TYPO3-dev] Ajax, page type and plugin settings

Éric Thibault Eric.Thibault at dc.ulaval.ca
Tue Mar 17 16:05:50 CET 2015


Hello to all!

I'm converting an old script (standalone PHP) into a new plugin and I'm using for the first time fluid templates. All the Typoscript configurations (default template folder, pid of records,...) are inserted in the Typoscript of all the site.  Everything is in order (configuration, database access, output, ...) except when I'm retrieving data via Ajax! Here is my setup:

Page typoscript:
============
ajaxCall = PAGE
ajaxCall {
  typeNum = 5000
#assign my new plugin...
  10 < plugin.tx_qr_pi1
 
  config {
    disableAllHeaderCode = 1
    xhtml_cleaning = 0
    admPanel = 0
    debug = 0
    no_cache = 1
  }
}

Call Ajax:
	//29977 uid of page inside my site that "normally" receives the global Typoscript settings... Is there a way to test this?
	$.ajax({
    		url: '/?id=29977&type=5000&tx_qr_pi1[ajax]=1',
   		data: 'methode=SINGLE&uid=' + uid_question,
   		success: function(result) {
        			alert(result);	
    		},
	});

If I return "allo" from my plugin (tx_qr_pi1), the Ajax call outputs the alert message "allo"!  

My problem is that in "ajax mode",  the variable $conf is empty... (print an empty array) thus my setup is not available!  In "normal mode", the variable $conf works like a charme (in the same class)!

Do I have to pass everything via POST or GET so that the "ajax mode" can know the setup or is there something to do so that the "ajax mode" automatically sees the setup?!?!!?

Thanks a million times for the information! 

Eric Thibault


More information about the TYPO3-dev mailing list