[TYPO3-mvc] Extend Extension

Stefan Kruse besucher80 at gmx.de
Mon Mar 24 16:49:31 CET 2014


Hi,

i have a little question. I want to extend the in2snippet extension with a
new field.

I made the follow steps:

Create a ext_tables.sql:

#
# Table structure for table 'tx_in2snippets_domain_model_code'
#
CREATE TABLE tx_in2snippets_domain_model_code (

	intro text NOT NULL,

	tx_extbase_type varchar(255) DEFAULT '' NOT NULL,

);

Create a ext_tables.php:

Here I made a new TCA Entry. This I don't show, because its not so
important.

Create a ext_typoscript_setup.txt:

config.tx_extbase{
    persistence{
        classes{

            \Tx_In2snippets_Domain_Model_Code {
                subclasses {
                    Tx_SkIn2snippetExtending_Code =
SK\SkIn2snippetExtending\Domain\Model\Code
					
          		}
            }
            SK\SkIn2snippetExtending\Domain\Model\Code {
                mapping {
                    tableName = tx_in2snippets_domain_model_code
                    recordType = Tx_SkIn2snippetExtending_Code
                }
            }
            
    	}
    }
}

Create the model with the new field:

class Code extends Tx_In2snippets_Domain_Model_Code {

	/**
	 * intro
	 *
	 * @var \string
	 */
	protected $intro;

	/**
	 * Returns the intro
	 *
	 * @return \string $intro
	 */
	public function getIntro() {
		return $this->intro;
	}

	/**
	 * Sets the intro
	 *
	 * @param \string $intro
	 * @return void
	 */
	public function setIntro($intro) {
		$this->intro = $intro;
	}

}

The new field is shown in backend, but not in the frontend template. If I
made a debug view, then I see that the new field don't appear. Is there an
error with the mapping? The classnames are right, but because namespacing
maybe? I use T3 6.1.

Would be nice if someone has a tip.

Thanks STefan



More information about the TYPO3-project-typo3v4mvc mailing list