Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6840795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:53:15+00:00 2026-05-26T23:53:15+00:00

I need to build a Typoscript file in PHP and then pretty much execute

  • 0

I need to build a Typoscript file in PHP and then pretty much execute the script to get the content of a given page.
This is my Code:

if (!defined('PATH_typo3conf')) die ('Could not access this script directly!');

class ContentHandler extends tslib_cObj
{
    var $conf;

    public function __construct()
    {
        tslib_eidtools::connectDB();
    }

    public function main()
    {
        $this->createConf(16);

        $code = $this->cObjGet($this->conf);

        echo "<pre>";
        print_r($this->conf);
        echo "</pre>";

        echo "<pre>";
        echo "code: " . $code;
        echo "</pre>";
    }

    protected function createConf($pid)
    {
        $this->conf = array(
            'foo' => 'CONTENT',
            'foo.' => array(
                'table' => 'tt_content',
                'select.' => array(
                    'pidInList' => $pid,
                    'languageField' => 0,
                ),
                'renderObj' => 'COA',
                'renderObj.' => array(
                    'stdWrap.' => array(
                        'wrap' => '<b>|</b>',
                    ),
                    '10' => 'TEXT',
                    '10.' => array(
                        'field' => 'header',
                        'wrap' => '<h3>|</h3>',
                    ),
                    '20' => 'TEXT',
                    '20.' => array(
                        'field' => 'bodytext',
                        'wrap' => '<b>|</b>',
                    ),
                ),
            )
        );
    }
}

I believe the typosript is built well, but I don’t get anything back. I check with a simple mysql_query() and it returns content. But I need to do this with typoscript.

Any help appreciated!

Edit: This not an actual extension script, but it’s inside the EXT/ folder.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:53:15+00:00Added an answer on May 26, 2026 at 11:53 pm

    Your TypoScript is not correct. Have a look at the API (http://api.typo3.org/typo3v4/current/html/classtslib__c_obj.html#ab70d69a447f24f7416a85e7de1cb4ffb). Instead of “foo” you have to define an numerical key “10”.

    $this->conf = array(
                'foo' => 'CONTENT',
                'foo.' => array(
    

    should do the job.

    Btw.:
    You need tslib_eidtools::connectDB(); only, if you are using an eID Script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to build a XML file of my SQL table. This is my
I need to build a window designed to look exactly like this (it has
I need to build some cross platform cpp files in my android mk file.
I need to build a little wizard that looks like this where you walk
I need to build simple site one big page like 37signals product's pages, and
Need to build a query showing how much customers spend money per week, month,
I need to build an app (PHP/MySQL but I don't think it matters), letting
I need to build a jar file that includes (other, external projects') Maven artefacts.
I need to build a web page with a DetailsView which has a bunch
I need to build a webpage of just a humble content (a logo and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.