[TYPO3-shop] tt_products 2.7.0 marker as cobj

Franz Holzinger franz at ttproducts.de
Tue Dec 30 09:59:10 CET 2008


Hello Niels Tiedt,

> hi list
> in tt_products you can use own markers.
> e.g. ###OWN_MARKER###
> plugin.tt_products.marks.OWN_MARKER = ghghghgh
> 
> but it don?t render it as cobj.
> e.g.
> plugin.tt_products.marks{
> OWN_MARKER = COA_INT
> OWN_MARKER {
> 10 = TEXT
> 10.value = OWN_MARKER
> }
> }

This will work:

plugin.tt_products.marks{
OWN_MARKER = COA
OWN_MARKER {
10 = TEXT
10.value = OWN_MARKER
}
}

> is it posible to insert the function in the extension?
> i use this snipped in combination with an modified 
> marker/class.tx_ttproducts_marker.php
> 
> row 104
> $markerArray['###'.$key.'###'] = $value;
> 
> replaced with
> if($this->conf['marks.'][$key][$value]){
> $markerArray['###'.$key.'###'] = 
> $this->cObj->cObjGetSingle($this->conf['marks.'][$key],$this->conf['marks.'][$key.'.']); 
> 
> }else{
> $markerArray['###'.$key.'###'] = $value;
> }
> 
> with the modified version u can render every ts in the own marker.
> e.g. render the mini-basket link as realurl-link
> oder use it to insert forms in a single view

So this seems to be really a good thing!
I will insert this into all next versions of tt_products:

if (is_array($this->conf['marks.']))	{
		// Substitute Marker Array from TypoScript Setup
	foreach ($this->conf['marks.'] as $key => $value)	{

		if (is_array($value))	{
			switch($key)	{
				case 'image.':
					foreach ($value as $k2 => $v2)	{
						$fileresource = $this->cObj->fileResource($v2);
						$markerArray['###IMAGE'.strtoupper($k2).'###'] = $fileresource;
					}
				break;
			}
		} else {
			if(isset($this->conf['marks.'][$key.'.']) && 
is_array($this->conf['marks.'][$key.'.']))	{
				$out = 
$this->cObj->cObjGetSingle($this->conf['marks.'][$key],$this->conf['marks.'][$key.'.']);
			} else {
				$out = $value;
			}
			$markerArray['###'.strtoupper($key).'###'] = $out;
		}
	}
}

IMHO the markers should always be upper case letters, to avoid confusion.

> these things i have build with the modified version in one t3-installation
> 1: used it in combination with typo3 form to make tt_products an auction 
> plattform in one tree.
> - bidding
> - bid-timer who counts down. if the auction end no biddind is posible
> - 2 bid-mails(admin and user)
> - use sr_feuser_register and fill in the userdata with own-markers.
> 2: in another tree i used an different template with own markers for an 
> inquiry form
> - with own form field
> - validation.

Many thanks for your proposal!

Have a good start into the next year 2009!

- Franz




More information about the TYPO3-project-tt-products mailing list