[TYPO3-ttnews] extend news 2

Frank Gerards F.Gerards at esolut.de
Thu Apr 5 16:21:45 CEST 2012


Hi,

- kickstart an extbase/fluid extension with extension_builder and a model "news", which contains your ADDITIONAL fields as properties 

- check the Configuration/TCA/News.php file if the backend representation is right

- in the static TS Template of that extension (Configuration/TypoScript/setup.txt) add the following lines:
   config.tx_extbase.persistence.classes {
    Tx_<MyExtKey>_Domain_Model_News {
        mapping {
            tableName = tx_news_domain_model_news
        }
    }
}

-output the modified model with this viewhelper in the "News" Extension views, that comes with the news-extension:
<n:object newsItem="{newsItem}" as="addonFields" className="Tx_<MyExtKey>_Domain_Model_News">

Basically what you do is register a mapping to the tx_news_domain_model_news in extbase. This way, extbase builds your model with all standard
News-Model properties PLUS your additional fields. Then you can use this in Fluid as u like.

Greetz,
frank


-----Ursprüngliche Nachricht-----
Von: typo3-project-tt-news-bounces at lists.typo3.org [mailto:typo3-project-tt-news-bounces at lists.typo3.org] Im Auftrag von Anna Doring
Gesendet: Donnerstag, 5. April 2012 15:26
An: typo3-project-tt-news at lists.typo3.org
Betreff: [TYPO3-ttnews] extend news 2

Hi,

I'm sorry for starting a new thread, but I didn't find a possibility to answer to the old one for me as a new subscriber. I'm referring to: 
[TYPO3-ttnews] extending news - Wed Mar 7 09:21:15 CET 2012

Can somebody give more details how to add new fields to a news record? 
Example: If an arcticle refers to a location there should be a field for the name of the location. Using the kickstarter, there is no problem, but I want to use a future-proof method. I tried the extension builder, but I only succeed in adding a new news time. Well, that's not what I want.

All the best
Anna
_______________________________________________
TYPO3-project-tt-news mailing list
TYPO3-project-tt-news at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-tt-news


More information about the TYPO3-project-tt-news mailing list