-1

I got a website (Typo3 9.5) already configured with existing typoscript and a bunch of pages.

Now I want to create an extension which simply adds one line of code to every page when a checkbox in the backend for this specific page is set. Like a "Show Editor [x]" checkbox which then adds a simple fixed to this exact page.

I know there must be an easy way to get this to work but I have no idea how to do it. Right now I'm thinking about manipulating the PAGE object in Typoscript and just add a on 10000000 with all the needed variables inside. But there must be a better way.

Starzi
  • 71
  • 7

1 Answers1

2

Your Requirements are actually multiple tasks which can be seperated:

  • Backend UI
  • Fetching the Editor of the Page
  • display that data in the frontend

Backend UI

adding a checkbox to the TYPO3 Backend requires you to add TCA Overrides to define an addtional field for the pages table. and and ext_tables.sql to adapt the database schema (you need to store this value in the database)

Fetching the Editor of the Page

what is the editor of the page? is it the "author" field of the page record? the user who initally created the page? the person who created the most content elements on the page? this of course has to be solved by you.

in the similes way its just text field and you can use it right away in the typoscript for more complex scenarious you might create a viewHelper, dataProcessor or userFunc to resolve the Author.

display that data in the frontend

you now should have somehow fetched the user. and you need to "insert" it at the correct place in you page template. if its just a simple value it should be straight forward adapting add it to your typoscirpt PAGE object. or FLUIDTEMPLATE

Wolffc
  • 1,176
  • 6
  • 9
  • Thanks for your answer. I'm trying right now to get the be_users by CONTENT object. I seem to be doing something wrong. It's just the last step to display the data but I am totally stuck. Working on it for about 3 Hours now without any sort of advancement. – Starzi Jan 05 '23 at 16:30