[TYPO3-shop] extended ListView
Seytzhan A.
seyitjan.abdrahmanov at gmail.com
Wed Aug 2 07:18:40 CEST 2006
Hi, Tomasz!
Maybe i'm doing something wrong? But there is no new fields in listview
mode...
Here is my code:
1. i created new extension with required fields;
2. i add following to "ext_localconf.php" file of my extension
*****************************************************************
$TYPO3_CONF_VARS['EXTCONF'][TT_PRODUCTS_EXTkey]['extendingTCA'][] =
$_EXTKEY;
$TYPO3_CONF_VARS['EXTCONF'][TT_PRODUCTS_EXTkey]['getItemMarkerArray'][]
=
t3lib_extMgm::extPath($_EXTKEY).'class.user_seyitrealtyshop_regionhook.php';
*****************************************************************
3. This is my "class.user_seyitrealtyshop_regionhook.php" in root of my
extension
*************************************************************
<?php
class user_seyitrealtyshop_regionhook {
function getItemMarkerArray ($pObj, &$markerArray, $item, $catTitle,
$tt_products, $tt_content, $imageNum, $imageRenderObj, $forminfoArray)
{
$row = &$item['rec'];
$markerArray['###PRODUCT_REGION###'] ='test-data' ;
}
?>
*************************************************************
4. i add marker ###PRODUCT_REGION### in my template file.
And there is nothing in frontend. In backend everything is ok.
Where is the problem?
Thanx in advance.
With respect,
Seytzhan.
Tomasz Rakowski wrote:
> Seytzhan A. napisał(a):
>> Hi, Tomasz!
>> Could u explain me shortly, how did u extend your tt_products table?
>> And how to set own markers in template?
>> I can't find anything about this in manual...
>>
>> I am using tt_products 2.5.0, typo3 3.8.1
>>
>> Thanx in advance!
>> Seytzhan.
>>
>> Tomasz Rakowski wrote:
>>> Tomasz Rakowski napisał(a):
>>>> Hello!
>>>>
>>>> I am using tt_products 2.4.8, typo3 3.8.1
>>>> I have extended my tt_products table. Everything is ok in the
>>>> backend, new fields are displayed, data is written to database. All
>>>> works fine there.
>>>> I wanted to dispaly some new fields in the listview mode and it
>>>> turned out that it does not work. My markers are substituted with
>>>> nothing in listview, but work fine in single view.
>>>> Debugging showed me that for listview only some specific fields are
>>>> taken:
>>>> [0] => uid [1] => pid [2] => category [3] => price [4] => price2 [5]
>>>> => title [6] => image [7] => subtitle
>>>>
>>>> How to change this? Is there something like listview parameter in
>>>> tt_products configuration? I want it to read all my fields in
>>>> listview, tell me if it's possible?
>>>>
>>>> thx in advance!!
>>>> racco
>>> ok, I figured that out;
>>>
>>> markers must start with PRODUCT_ to get them listed on listView
>>>
>>>
>>>
>>> cu
>>> racco
>
>
> [1.] Create an extensions which adds your additional fields to the
> relevant tt_products tables using the kickstarter.
>
> [2.] Add the following hook to your extensions ext_localconf.php file:
> $TYPO3_CONF_VARS['EXTCONF'][TT_PRODUCTS_EXTkey]['extendingTCA'][] =
> $_EXTKEY;
>
> [3.] Use the hook 'getItemMarkerArray' in tt_products to render your
> additional fields:
> [3a.] Create your custom script to render these additional fields, e.g.
> path/to/my/script/filename.php
> The function you can hook looks like this:
> function getItemMarkerArray ($pObj, &$markerArray, $item, $catTitle,
> $tt_products, $tt_content, $imageNum, $imageRenderObj, $forminfoArray)
> [3b.] Add your script to the tt_products hook in your extensions
> ext_localconf.php file:
> $TYPO3_CONF_VARS['EXTCONF'][TT_PRODUCTS_EXTkey]['getItemMarkerArray'][]
> = 'path/to/my/script/filename.php:&my_custom_class';
>
>
> Example hook_file:
>
> class tx_shopnewfile_hook {
>
>
> function getItemMarkerArray ($pObj, &$markerArray, $item, $catTitle,
> $tt_products, $tt_content, $imageNum, $imageRenderObj, $forminfoArray)
> {
>
> $row = &$item['rec'];
>
>
> $markerArray['###INSTRUKCJA###'] ='<a
> href="uploads/tx_ttproducts/instrukcje/'.$row['tx_shopnewfield_plik'].'">'.'Pobierz
> plik'.'</a>' ;
>
> }
>
>
>
> greetings
> racco
More information about the TYPO3-project-tt-products
mailing list