Die TYPO3 Mailingliste - nicht fragen: lesen!
This is a discussion on [TYPO3] userFunc not called correctly within the typo3-english@lists.netfielders.de forums, part of the TYPO3-Mailinglists: ENGLISH category; Hello, I'm trying to call a userFunc to filter the entries of my sitemap. I've used the same ...
|
|||||||
| Registrieren | Hilfe | Benutzerliste | Kalender | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
|
#1
|
|||
|
|||
|
Hello,
I'm trying to call a userFunc to filter the entries of my sitemap. I've used the same function on another menu and it worked. Somehow I can't get the call to the userFunc to work with the sitemap code: page.includeLibs.auchegal = fileadmin/scripts/userfunctions.php lib.sitemap = COA lib.sitemap { 10 = HMENU 10.cache_period = 0 10.special = directory 10.special.value.field = pages** 10.1 = TMENU 10.1 { *** itemArrayProcFunc = user_functions->user_menu I added an echo to the first line of the userFunc to check wether it's called at all but it isn't. I used the same code as in the other menu to call it: page.includeLibs.rechtegal = fileadmin/scripts/userfunctions.php menu2 = HMENU menu2.entryLevel= 1 menu2.cache_period = 0 menu2.1 = GMENU menu2.1{ itemArrayProcFunc = user_functions->user_menu The sitemap code is inside an extension template and the menu code inside a base template but that shouldn't make any difference. Regards Michael _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#2
|
|||
|
|||
|
Hello,
> The sitemap code is inside an extension template and the menu code inside a base template but that shouldn't make any difference. Just a guess: 1) are you sure you included your extension's setup? 2) the order of include does not override the menu TS definition? -- Xavier Perseguers http://xavier.perseguers.ch/en/tutorials/typo3.html _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#3
|
|||
|
|||
|
The menu's code is inside a base template which itself is included in the root template. So I guess the code to include the userFunc in the sitemap's ext-template ist redundant as it is always included by the root template already.
However this second inclusion shouldn't hurt and removing it doesn't help either. It looks like the way I call the userFunc in the ext-template is not correct although it looks a lot like the other one.. --- On Tue, 6/24/08, Xavier Perseguers <typo3 (AT) perseguers (DOT) ch> wrote: Just a guess: 1) are you sure you included your extension's setup? 2) the order of include does not override the menu TS definition? _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#4
|
|||
|
|||
|
there's a quick scetch of the two ways I'm including the userFunc:
http://img117.imageshack.us/my.php?image=sitemaprl6.jpg it is already included through the root template. the sitemap page also contains the filtered menu where the userFunc works. for testing I put the sitemap code inside another base template which is included in the ext-template without success. --- On Tue, 6/24/08, Xavier Perseguers <typo3 (AT) perseguers (DOT) ch> wrote: From: Xavier Perseguers <typo3 (AT) perseguers (DOT) ch> Subject: Re: [TYPO3] userFunc not called correctly To: typo3-english (AT) lists (DOT) netfielders.de Date: Tuesday, June 24, 2008, 9:46 AM Hello, > The sitemap code is inside an extension template and the menu code inside a base template but that shouldn't make any difference. Just a guess: 1) are you sure you included your extension's setup? 2) the order of include does not override the menu TS definition? -- Xavier Perseguers http://xavier.perseguers.ch/en/tutorials/typo3.html _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#5
|
|||
|
|||
|
Hello,
after another night of testing I figured out that there is a problem with the actual function call. When I add a constructor containing an echo output to the class this output is generated. So the constructor is called but the function isn't. Again here is the code. Maybe someone cann tell me what's wrong with it: page.includeLibs.some_other_random_id_string1 = fileadmin/scripts/user_test.php ...... itemArrayProcFunc = user_test->user_myfunc And here is the php code from user_test.php: class user_test{ * function user_test() {echo "test";} * function user_myFunc($menuArr, $conf){ *** echo "gotcha"; *** } } When commenting out the constructor the function isn't called either. Beats me. --- On Tue, 6/24/08, Xavier Perseguers <typo3 (AT) perseguers (DOT) ch> wrote: From: Xavier Perseguers <typo3 (AT) perseguers (DOT) ch> Subject: Re: [TYPO3] userFunc not called correctly To: typo3-english (AT) lists (DOT) netfielders.de Date: Tuesday, June 24, 2008, 9:46 AM Hello, > The sitemap code is inside an extension template and the menu code inside a base template but that shouldn't make any difference. Just a guess: 1) are you sure you included your extension's setup? 2) the order of include does not override the menu TS definition? -- Xavier Perseguers http://xavier.perseguers.ch/en/tutorials/typo3.html _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#6
|
|||
|
|||
|
On mié, 2008-06-25 at 02:09 -0700, Michael Niemann wrote:
> Hello, > > after another night of testing I figured out that there is a problem with the actual function call. When I add a constructor containing an echo output to the class this output is generated. So the constructor is called but the function isn't. > > Again here is the code. Maybe someone cann tell me what's wrong with it: > > page.includeLibs.some_other_random_id_string1 = fileadmin/scripts/user_test.php > ..... > itemArrayProcFunc = user_test->user_myfunc > > And here is the php code from user_test.php: > > class user_test{ > function user_test() {echo "test";} > function user_myFunc($menuArr, $conf){ > echo "gotcha"; > } > } > > When commenting out the constructor the function isn't called either. Try the next code: includeLibs.user_test = fileadmin/scripts/user_test.php page.20 = TEXT page.20.postUserFunc = user_test->user_myfunc # itemArrayProcFunc = user_test->user_myfunc ¿Can you read "gotcha"? Regards. -- Antonio Ãlvarez Feijoo Computer Science Engineer mailto:aalvarez (AT) igalia (DOT) com Igalia - http://www.igalia.com _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#7
|
|||
|
|||
|
yes. it's displayed. very strange.
--- On Wed, 6/25/08, Antonio Alvarez <aalvarez (AT) igalia (DOT) com> wrote: Try the next code: includeLibs.user_test = fileadmin/scripts/user_test.php page.20 = TEXT page.20.postUserFunc = user_test->user_myfunc # itemArrayProcFunc = user_test->user_myfunc ¿Can you read "gotcha"? _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#8
|
|||
|
|||
|
On mié, 2008-06-25 at 02:52 -0700, Michael Niemann wrote:
> yes. it's displayed. very strange. > I don't know why but if the name of the function included with includeLibs doesn't begin with "user_" it doesn't work! includeLibs.user_... Regards. -- Antonio Ãlvarez Feijoo Computer Science Engineer mailto:aalvarez (AT) igalia (DOT) com Igalia - http://www.igalia.com _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#9
|
|||
|
|||
|
I've also tried it both with class and function prefixed with user_.
My workaround was to create an extension which creates the whole sitemap. Sometimes it seems you're better off to not to try to understand why something isn't working in TYPO but to write own functionality. --- On Mon, 6/30/08, Antonio Alvarez <aalvarez (AT) igalia (DOT) com> wrote: From: Antonio Alvarez <aalvarez (AT) igalia (DOT) com> Subject: Re: [TYPO3] userFunc not called correctly To: "TYPO3 English" <typo3-english (AT) lists (DOT) netfielders.de> Date: Monday, June 30, 2008, 3:14 PM On mié, 2008-06-25 at 02:52 -0700, Michael Niemann wrote: > yes. it's displayed. very strange. > I don't know why but if the name of the function included with includeLibs doesn't begin with "user_" it doesn't work! includeLibs.user_... Regards. -- Antonio Álvarez Feijoo Computer Science Engineer mailto:aalvarez (AT) igalia (DOT) com Igalia - http://www.igalia.com _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
| Themen-Optionen | Thema durchsuchen |
| Ansicht | Thema bewerten |
|
|
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| [TYPO3] How to modify tt_content correctly? | Andreas Balzer | typo3-english@lists.netfielders.de | 0 | 23.12.2007 23:47 |
| [TYPO3] JSeventFunctions() called before plugin code is executed | Karsten Dambekalns | typo3-english@lists.netfielders.de | 0 | 21.07.2007 13:09 |
| [TYPO3] Hook is not called in just ONE installation, why? | Matthias Stuebner | typo3-english@lists.netfielders.de | 2 | 06.05.2007 22:57 |
| [TYPO3] utf-8 to show up correctly not only in FE/BE but in mysqlclients, too? | Giannis Economou | typo3-english@lists.netfielders.de | 6 | 12.03.2007 14:56 |
| Re: [TYPO3] sp_directory and utf-8 doesn't work correctly | Julo Ferianc | typo3-english@lists.netfielders.de | 0 | 10.12.2006 01:22 |