• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 604
  • Last Modified:

Typo3: read URL parameter and display in template?

I bet it is very simle but I am just too dumb. I have the following code in Typo3 template:
-------------------
IMPORTED-MENU = PHP_SCRIPT_EXT
IMPORTED-MENU {
 file = fileadmin/smo_latesttopics_export.php
}
-------------------

The URL will have a parameter named "act".

3 questions:
1) How should the code look like that I display the value of the paramater at the marker "IMPORTED-MENU"?
2) What is the code that the parameter will be used "as is" when calling the include?
3) Is it possible to use a variable in typoScript that can be used from the PH include too? (to avoid calling the include wiht a parameter in the URL)?
0
Smoerble
Asked:
Smoerble
1 Solution
 
m1tk4Commented:
First - I am not sure "-" is allowed as a part of TS object name, however I may be wrong.

1. <? echo t3lib_div::_GET('act'); ?>

You can also go for the GET/POST variables directly, however if you use RealURL or some other extensions your scripts will be broken. This is why you need to go through the standard TYPO3 API - see http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.1.0/view/3/2/#id3526172 for details

2. Not sure I understand the question. The code configured as "PHP_SCRIPT_EXT" is called using include() from the core, so all global variables available at that moment are available to it too. There are no parameters passed to it since it's not a function - there are only parameters passed to the whole PHP application and stored in the global vars.

3. There are several ways to do it. What is the nature of informaiton that you are trying to pass to your script? Depending on whether it is page-specific, template specific or otherways there could be options.
0
 
SmoerbleAuthor Commented:
Thanks for your help.
Regards
Smo
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now