Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
337 views
in Technique[技术] by (71.8m points)

How to store pid of current page with the SaveToDatabaseFinisher and TYPO3 EXT:Form

I want to store the form data in the database using the SaveToDatabaseFinisher. The data should be assigned to the page, where the form Plugin is placed on and I don't know how to find the pid of the current page. In every example I found, the pid was always hard coded in the yaml file.

I tried {pid} and {__pid} without any success. So how to get the current page's id (pid) to store it in the database (in TYPO3 8.7)? Or is it only possible in a later T3 release?

  ...
  databaseColumnMappings:
    pid:
      value: '{__pid}'
    tstamp:
      value: '{__currentTimestamp}'
  elements:
    ...
question from:https://stackoverflow.com/questions/65855319/how-to-store-pid-of-current-page-with-the-savetodatabasefinisher-and-typo3-extf

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Since runtime references are currently not extensible besides form values you need to add a custom finisher which determines the current page ID and stores it as finisher variable. Then you can access this variable in the SaveToDatabase finisher configuration.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...