[TYPO3-dev] Dynamic Backend Editing

Bernhard Kraft kraftb at kraftb.at
Fri Sep 8 16:37:30 CEST 2006


Hello again,

> Okay, mine is not possible with flexforms, but with the regular TCEforms
> on using $TCA.

Mine also has nothing to do with Flexforms - I just mentioned that the same concept
is already known in T3 Flexforms - and there the concept is called "Sections"
(Did you ever use TV ? or especially Flexform Sections ?)
http://typo3.org/documentation/document-library/core-documentation/doc_core_api/current/view/7/1/
(Search for "section")

>>I guess it happend again that two people did the exactly same thing :)
> 
> 
> Maybe I'd like to go out, run around and scream loudly. But I don't do
> that, because it's goofy. ;)

It will almost be not avoidable that some work gets created twice :) sad but true.

> I searched the TYPO3.org page and Google before starting with my
> extension and found nothing suitable - of course I looked for something
> with the word "dynamic". Perhaps we should build up a thesaurus, a
> dictionary or whatever to make sure, that we talk about the same in
> future. An option could also be to insert some explaining keywords to
> the TER description.

I guess you searched for "dynamic" cause you solution allows you to add the new sections
dynamically using AJAX ...

My extension behaves rather like Flexform sections where you have to save after each
change (i.e: adding a new section element, moving around section elements)

I do understand now why you used the term "Dynamic" for your extension - mine focues rather
on the concept of listing multiple "1:n" related records inside a "normal" T3 record.

> So if I got it right, the "dynamic fields" or "repeatable content
> element" are created in your extension by clicking the save-button. So
> if you want to create 10 new elements, you have to save 10 times, don't
> you? So you don't use ajax or technics like that?

No - I guess this is the difference between our extensions - but you would for sure have been
a lot quicker if you would have based your work on my TCA-section extension - it is coded quite
clear and straight forward.


> So summarize, kb_tca_section brings dynamic to flexforms using TCA
> tables,

I guess we misunderstood us - you talk about AJAX stuff .. i talk about data structures. My
extension brings absolutely nothing "AJAX-dynamic" stuff ...

> dynaflex brings dynamic to flexforms and

AFAIK also the "dynamic" of dynaflex is rather focues on "reloading" the page and getting other
fields and Tabs ... but not based on AJAX


> dynbeedit brings
> dynamic to regular TCEforms using TCE tables and xajax.

You are focusing on updating the BE-forms using an AJAX concept - i guess this is a neat thing
to have but we should approach it in a more "general" way - i.e. having a t3lib_tceforms_ajax.php
class which renders tceforms using AJAX.

> So is there a way to put these three things together in a "strategy"?

As i mentioned before my kb_shop extension already features those "sections" (what your dynbeedit
brings in an AJAX way) - my kb_shop extension is mostly the same as what dynaflex is - except that
it does not base it's rendering on flexforms but rather on TCA-tables - but you can dynamically (in
a mean of not requiring to edit ext_tables.sql, etc. files) add fields (and such sections) to your
"product" (or whatever) tables.

dynaflex renders flexforms with the required fields and then when storing the content it saves the
values of the fields to some kind of "property table" ...

my extension rather creates the TCA, ext_tables.php, ext_tables.sql "on-the-fly" (when shop-cache get's
cleared) and let's you thus create/edit records using the common/traditional t3lib_tceforms/alt_doc record
edit screens.


So what would be nice is if your extension "dynbeedit" would share a compatible data-structe with
the tca_section extension so your extension can get used as a drop-in replacement when using kb_shop
so it is possible to dynamically add section elements :)

I saw that you also use a TCA type=userFunc field for creating the section content ... You TCA defintion
is like:

TCA['tx_myExtensionTable']['columns']['myField'] = Array(
  'exclude' => 1,		
  'label' => 'something',
    'config' => array(
      'type' => 'user',
      'userFunc' => 'tx_dynbeedit->start',
        'params' => array(
          'table' => 'tx_myOtherExtensionTableToEmbed',
          'singleViewClickBehaviour' => 1,
          'collapseInstances' => 1,
        ),
      ),
    ),
  ),
);

mine is like:

TCA['tx_myExtensionTable']['columns']['myField'] => Array (
      'exclude' => 1,
      'label' => 'LLL:EXT:kb_nntp_if/locallang_db.php:tx_kbnntpif_messages.parts',
      'config' => Array (
        'type' => 'user',
        'userFunc' => 'EXT:kb_tca_section/class.tx_kbtcasection.php:tx_kbtcasection->getSingleField_typeSection',
        'el' => array(
          'tx_kbnntpif_message_parts' => &$GLOBALS['TCA']['tx_kbnntpif_message_parts'],
        ),
      )
    );

And you need additonally in the "referenced table"'s TCA 'ctrl' section:

$TCA['tx_kbnntpif_message_parts'] = Array (
  'ctrl' => Array (
    ...
    'sectionParentField' => 'msgparent',
    ...
  )
)

which defines which field shall contain the "parent-relation" ...


You notice that I just reference the TCA of the table which shall get displayed "inside" ...
this has the advantage that you can have a different TCA definition (you could simply start the complete
TCA again there) when viewing section records "inside" another record than when viewing them "stand-alone"


BTW: I introduced the page-TS-config option:

mod.web_list.hideTables = tx_mytable_tableA,tx_mytable_tableB

in TYPO3 4.0.0 - using this option it is possible to hide the "realted" tables from "normal" editing - as those
records should mostly only get edited from within their parent records ....



greets,
Bernhard
-- 
----------------------------------------------------------------------
"Freiheit ist immer auch die Freiheit des Andersdenkenden"
Rosa Luxemburg, 1871 - 1919
----------------------------------------------------------------------
[[ http://think-open.at | Open source company ]]




More information about the TYPO3-dev mailing list