[TYPO3] Including a php file

christian oettinger christian.oettinger at gmx.de
Sat Aug 25 14:38:19 CEST 2007


It may be difficult to find the place where typo3 includes your script. 
Which php-file are you looking at, and even more importat, why? Note 
that the php-files are not parsed, so they won't change with yor 
setup-configuration.
So back to the basic problem: It's not working, is it that? Maybe I just 
misunderstood you.
Anyway, I know I struggeled too, so I just include a setup that's 
working, hope this helps. (Was there a problem with .inc-files, I do not 
remeber, sorry)

christian (das oe)

--------- SETUP ---------

# file rights must allow the script to be executed!!
includeLibs.oemenuitems = fileadmin/scripts/oe_itemArrayProcFunc.php

page.15.2 = TMENU
page.15.2 {
    fontColor = #ffffff
    expAll = 0
    # defining which function to call
    itemArrayProcFunc = user_itemArrayProcFuncTest
    itemArrayProcFunc.userFunc.oe_table = {$oe_menu_table}

    # passing variables to the script
    itemArrayProcFunc.userFunc.variableforthescript = whatever


    NO {
       doNotLinkIt = 1
       ATagBeforeWrap = 1
       linkWrap = |
       stdWrap {
          data = field:name
          typolink {
             wrap = <SPAN class="dritteebene"> | </SPAN><BR>
             ATagBeforeWrap = 1
             parameter.data = TSFE:id
             additionalParams.field= uid
             additionalParams.wrap= &tx_oecertificates_pi1[showUid]=|
             useCacheHash = 1
             maxWidth = 40
          }
       }
      #stdWrap.data = debug:data
   }
}

---------
--------- SCRIPT ---------

function user_itemArrayProcFuncTest($menuArr,$conf)	{

...

}


> I've searched the forums but I cannot seem to find the solution to this seemingly simple question. I'm trying to include a PHP file to build a custom menu as mentioned here (http://typo3.org/documentation/document-library/references/doc_core_tsref/4.1.0/view/8/11/). 
> 
> To include the file, I'm using:
> 
> page.config.includeLibrary = fileadmin/template/main/php/quicklinks_menu.inc
> 
> The contents of the .inc file are identical with the link above excepting that I wrap the function in a class called quicklinks_menu. 
> 
> But when I look at the source on the PHP file, I don't even seen where the quicklinks_menu.inc file is being included. I'm assuming that I should be able to see it there correct? Also, is there a more complete example than the link I've provided?


More information about the TYPO3-english mailing list