[TYPO3] trying to call some custom code to pass a session into tsfe for access from typoscript... help

Peter Klein peter at umloud.dk
Tue Nov 13 09:24:34 CET 2007


Hi Andrew. Have you tried:

$$TSFE["read_session"] = $GLOBALS["TSFE"]->fe_user->getKey("ses","store");As 
described 
here:http://typo3.org/documentation/document-library/references/doc_core_tsref/4.1.0/view/14/1/-- 
Peter Klein/Umloud Untd"Andrew Davis" <junk at avagraphique.com> skrev i en 
meddelelse 
news:mailman.1.1194894355.18251.typo3-english at lists.netfielders.de...
> Hi I am trying to read a session variable, and have it accessable to
> my ts...
>
> we have a cart (different, non typo3 script) that sets a session and
> goes back to typo3. Idf that session is set we want a different menu
> (HMENU, simple stuff) to display.
>
> But since the session isnt set by typo3, not sure how to get that info
> to be accessible by typo3.
>
> we thought to do this:
>
> 1. Make an extension that reads the session and passes it to the tsfe.
> in the extension is this:
>
> function main($content,$conf) {
> $this->conf=$conf;
> $this->pi_setPiVarDefaults();
> $this->pi_loadLL();
> $this->pi_USER_INT_obj=1; // Configuring so caching is not expected.
> This value means that no cHash params are ever set. We do this,
> because it's a USER_INT object!
> $TSFE["read_session"] = $_SESSION['store'];
>
>
> }
>
>
> 2. then in the ts template we call the function specifically
>
> temp.pass_session = USER
> temp.pass_session.userFunc = tx_core101readsession_pi1->main
>
>
>
> 3. then i do a conditional statement to crete the menu
>
> [globalVar = TSFE:read_session = showcase]
> temp.menu_1_t3.special = list
> temp.menu_1_t3.special.value = 22,23,24,25,9
> [else]
> temp.menu_1_t3.special = list
> temp.menu_1_t3.special.value = 11,22,23,24,25,9
> [end]
>
>
>
>
> but it doesnt seem to be doing anything. Any suggestions? PLease be
> specific.
>
> Thanks very much in advance,
>
> Andrew Davis
>
>
>
> -- 
> I'm trying a new usenet client for Mac, Nemo OS X.
> You can download it at http://www.malcom-mac.com/nemo
> 




More information about the TYPO3-english mailing list