Kommunist24
Kommunist24

Reputation: 1

TYPO3: How can i create a custom page type url with typeNum=20 and reference that on the Controller

I created an empty function. And I have a xml file which has information inside. I want to send this file with Postman to this URL and save the information with my function. Anyone any ideas ? Thanks for your help.

Upvotes: 0

Views: 1268

Answers (2)

gautamsinh mori
gautamsinh mori

Reputation: 323

Your TypoScript object will be like this

mycustompageType = PAGE
mycustompageType{
       typeNum = 1897
       config {
             #Required configuration
       }
       10 = USER_INT
       10{
         vendorName = YourVendorName
         userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
         extensionName = YourExtensionName
         pluginName = YourPluginName
         controller = YourController
         switchableControllerActions {
            YourController { 
              1 = YourAction
           }
        }
      }
   }

You can get extension detail using below code // get extension information

echo $this->request->getControllerExtensionName()."<br>"; 
echo $this->request->getPluginName()."<br>"; 
echo $this->request->getControllerName()."<br>";

Finally, you have to run this URL "yourdomain.com/?type=1897"

Enjoy!!

Upvotes: 1

Thomas L&#246;ffler
Thomas L&#246;ffler

Reputation: 6164

Hey there and welcome to StackOverflow.

I used to handle such a function recently and I did it this way:

  • Create a page type in TypoScript to handle typenum (in your case 20)
  • Listen to a special POST parameter (which you defined, e.g. data)
  • Add your code what should happen with the data
  • Send the information with POST and the XML via Postman to your.typo3.tld/?type=20

Upvotes: 1

Related Questions