[Typo3] Get Flexform data with TypoScript

Lars Houmark lars at houmark.com
Wed Jun 22 19:15:10 CEST 2005


> field_picture is a REAL field from the FlexForm (Type: Image) which I
> needed to insert a second time in my page but with different dimsnsions ..
>
> this script is doing the trick ...
> (But as I said: just works for the actually rendered page and not for
> pages retrieved via cObj CONTENT)

Will this mean that it also will not work when used through a menu? I am 
fighting here. Feel like I am close.
I edited your php class to this:

class user_icons {
    function getContentFlexValue($content, $conf)   {
       // out commented, not working in my scenario list($table, $uid) = 
t3lib_div::trimExplode(':', $GLOBALS['TSFE']->currentRecord, 1);
       $rec = $GLOBALS['TSFE']->sys_page->getRawRecord($conf['table'], 
$conf['uid']);
       $flexXML = $rec['tx_templavoila_flex'];
       $XML = t3lib_div::xml2array($flexXML);
       return $XML['data']['sDEF']['lDEF'][$conf['field']]['vDEF'];
    }
}

-----
The class is depending on the table to recieve from $conf['table'] and 
$conf['uid'] which is page to be linked in the menu. Not the current page, 
but the page which is being rendered.

Heres the menu code:

lib.mymenu = HMENU
lib.mymenu.special = directory
lib.mymenu.special.value = 65
lib.mymenu.1 = TMENU
lib.mymenu.1 {


  NO.ATagTitle.postUserFunc = user_icons->getContentFlexValue
  NO.ATagTitle.postUserFunc.field = field_status
  NO.ATagTitle.postUserFunc.table = pages
 # below is not working, which is the only thing left
 NO.ATagTitle.postUserFunc.uid.field = uid

  NO.ATagTitle.field = 10.field
  wrap = <ul id="mymenu" class="mymenu"> | </ul>
  NO.wrapItemAndSub = <li> | </li>
  ACT = 1
  ACT.wrapItemAndSub = <li> | </li>
  ACT.ATagTitle.field = title

}

To clarify. I am trying to output the value of the FF field field_status in 
the title text of the <a href>
It is later to become an icon, but to test, I try to put in as a title 
label.

Now, how would I get the uid of the page correctly filled into uid so that 
my class recieves it?

Is there another way. All I have found is examples and bits which relies on 
page.something or similiar like the one you just posted. What I need is to 
get this into the menu, so that I can have a page specific icon left to the 
menu item depending on the value in the status of the FF field.

Thanks for any help,

Lars 





More information about the TYPO3-english mailing list