Domanda

Is it somehow possible to add the sub-group of a cetrain group the address is assigned to the html output?

In the template I have ###MAINGROUP### and ###GROUPLIST###. I can't use maingroup, cause it's not the case that the group I need is always the maingroup. And with the grouplist I can't say which group is the sub-group of the one group.

Anyone have an idea how I could do it?

And in addition to that I also need the value of a self created field in the tt_address table.

Edit:

I try it like @lorenz say. What I have so far:

ext_localconf.php:

<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_address']['extraItemMarkerHook'][] 
='EXT:txnextaddresssort/class.tx_next_address_sort_addmarkers.php:tx_next_address_sort_addmarkers';

class.tx_next_address_sort_addmarkers.php:

<?php
class tx_next_address_sort_addmarkers {
    function extraItemMarkerProcessor(&$markerArray, &$address, &$lConf, 
        &$pObj) { 

        $lcObj = t3lib_div::makeInstance('tslib_cObj'); 
        $lcObj->data = $address; 

        $markerArray['###SORTBEREICH###']   = 
        $lcObj->stdWrap($address['tx_nextaddresssort_sort_bereich'], 
        $lConf['tx_nextaddresssort_sort_bereich.']); 

    } 

}

Extentionkey: next_address_sort

All I get is a blank screen, but no errors in apache log

È stato utile?

Soluzione

No, there is no possibility to do that.

Yet you can write a custom extension that integrates the extraItemMarkerProcessorhook in tt_address. In ext_localconf.php, add:

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['tt_address']['extraItemMarkerHook'][]     ='EXT:myextension/class.tx_myextension_filename.php:tx_myextension_classname';

Then add a file class.tx_myextension_filename.php to your extension.:

class tx_myextension_classname {

    public function extraItemMarkerProcessor(&$markerArray, &$address, &$lConf, &$pObj) {

      $lcObj = t3lib_div::makeInstance('tslib_cObj');
      $lcObj->data = $address;

      $markerArray['###MYFIELD###'] = $lcObj->stdWrap($address['myfieldlikeindatabase'], $lConf['myfieldlikeindatabase.']);

      return $markerArray;

    }

}

This would be an example for getting a field that is in the tt_address table and adding it to the markers so they can be used in a template. It is also stdWrap enabled.

Now, instead of getting a field, you should replace $address['myfieldlikeindatabase'] with a variable that contains the information you need. To receive the data, you can use the TYPO3 database API functions ($GLOBALS['TYPO3_DB']).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top