AYax TYPO3 Page Configuration

How to remove CSS Styled header output from Ajax header in TYPO3?

This is my Typoscript:

ajax = PAGE
ajax {
  typeNum = 1234
  # this solution is working, but then I don't have flexform values
  # 10 < tt_content.list.20.myextension_pi1

  10 < styles.content.get
  10 {
    select.where = colpos = 0
    select.andWhere = list_type='myextension_pi1'     
  }

  config {
    disableAllHeaderCode = 1
    additionalHeaders = Content-type:application/json
    xhtml_cleaning = 0
    admPanel = 0
    debug = 0
    no_cache = 1
  }
}

This is my Ajax result - Hello World - tt_content header:

<h2 class="csc-firstHeader">Hello World</h2>{"valid":false}

I tried already without success:

lib.stdheader > 
lib.header >

And this will affect ALL page types, and for standard output, I want to keep the tt_content header output.

+3
source share
3 answers

You cannot place tt_contentan element containing a plugin, but the plugin itself, for example:

ajax = PAGE
ajax {
  typeNum = 1234

  10 < plugin.myextension_pi1     

  config {
    disableAllHeaderCode = 1
    additionalHeaders = Content-type:application/json
    xhtml_cleaning = 0
    admPanel = 0
    debug = 0
    no_cache = 1
  }
}

see also a similar question

In this case, you do not need to change the CSC.

Of course, in this case you need to configure your extension through TS (preferably with the ability to combine TS config with FlexForm, like this )

Alternative:

  • ( Voucher page) - tt_conent .
  • uid (, 123) ajax, .: index.php?id=123&type=1234
  • TypoScript ( root!) Settings CSC ( )

    lib.stdheader > 
    lib.header >
    etc...
    

TypoScript CSC , ..

[globalVar = TSFE:id = 123]
    lib.stdheader > 
    lib.header >
[end]

type ( - , , , ):

[globalVar = GP:type = 1234]
    lib.stdheader > 
    lib.header >
[end]
+3

AJAX eID AJAX .

, , .

: Typo3 Extbase AJAX page typenum

+1

AJAX

tmp.ajaxConf = PAGE
tmp.ajaxConf {
    typeNum = 1249058000
    config {
        disableAllHeaderCode = 1
        xhtml_cleaning = 0
        admPanel = 0
    }
}

ajax_fullPage < tmp.ajaxConf
ajax_fullPage {
    typeNum = 1234567890
    10 < styles.content.get
}

AJAKS

var _currentURL = window.location; // Current URL Path
$.ajax({
    url: _currentURL,
    data: '&type=1234567890',
    cache:false,
    success: function(result) {
        // Code
    },
    error: function(result) {
        alert('Error');
    }
});
0
source

All Articles