[Frage] html5videoplayer erweitern

  • donenik donenik
    Padawan
    0 x
    52 Beiträge
    0 Hilfreiche Beiträge
    05. 06. 2014, 11:42

    Hallo zusammen,

    meine ersten Gehversuche mit extbase...

    Ich habe die Extension news mit Hilfe eines Tutorials schon um ein paar Tabellenfelder erweitert, jetzt brauche ich das Gleiche auch für die Extension html5videoplayer und habe irgendwo einen Knoten, vllt. kann mir jemand auf die Sprünge helfen.

    Meine ext_tables.php:
    [code language=php]
    <?php
    if (!defined('TYPO3_MODE')) {
    die ('Access denied.');
    }
    $tempColumns = array(
    'tx_html5video_clip' => array(
    'config' => array(
    'type' => 'group',
    'internal_type' => 'db',
    'allowed' => 'tx_html5videoplayer_domain_model_video',
    'size' => 3,
    'maxitems' => 3,
    'minitems' => 0,
    'show_thumbs' => 1,
    //'softref' => 'typolink',
    'wizards' => array(
    'suggest' => array(
    'type' => 'suggest',
    ),
    ),
    )
    ),


    'tx_html5video_noclip' => array(
    'exclude' => 1,
    //'label' => 'LLL:EXT:html5videocustom/Resources/Private/Language/locallang_db.xlf:tx_html5videocustom_domain_model_clip.noclip',
    'config' => array(
    'type' => 'check',
    'default' => 0
    )
    ),
    );

    t3lib_div::loadTCA('tx_html5videoplayer_domain_model_video');
    t3lib_extMgm::addTCAcolumns('tx_html5videoplayer_domain_model_video',$tempColumns,1);
    t3lib_extMgm::addToAllTCAtypes('tx_html5videoplayer_domain_model_video','--div--;Clip einstellungen,tx_html5video_clip;;;;1-1-1, tx_html5video_noclip');
    ?>
    [code/]

    Classes/Domain/Model/Video.php:

    [code language=php]
    <?php
    class Tx_Html5videocustom_Domain_Model_News extends Video {
    /**
    * @var string
    */
    protected $txHtml5videocustomClip;
    /**
    * @var string
    */
    protected $txHtml5videocustomNoclip;

    /**
    * @var string
    */
    public function txHtml5videocustomClip() {
    return $this->txHtml5videocustomClip;
    }
    /**
    * @var string
    */
    public function txHtml5videocustomNoclip() {
    return $this->txHtml5videocustomNoclip;

    }
    ?>
    [code/]

    Und in der Datei Resources/Private/extend-video.php steht:
    Domain/Model/Video

    Wenn ich jetzt versuche einen der Werte im Template so auszugeben: {video.txHtml5videocustomClip}
    kommt leider nix.

    Ich fürchte ich habe es noch nicht ganz verstanden :-)


  • 1
  • freeatweb freeatweb
    Jedi-Meister
    0 x
    267 Beiträge
    4 Hilfreiche Beiträge
    13. 06. 2014, 15:19

    Im Domain Model benötigst du pro Feld zwei functions - eine "set the field" und eine "return the field" (für die FE-Ausgabe --> die .

    Beispiel:

    1. /**
    2.  * Name
    3.  *
    4.  * @var \string
    5.  * @validate NotEmpty
    6.  */
    7. protected $name;
    8.  
    9. /**
    10. * Returns the name
    11. *
    12. * @return \string $name
    13. */
    14. public function getName() {
    15. return $this->name;
    16. }
    17.  
    18. /**
    19. * Sets the name
    20. *
    21. * @param \string $name
    22. * @return void
    23. */
    24. public function setName($name) {
    25. $this->name = $name;
    26. }

    Grüße

  • 1