|
|||||||
| Registrieren | Hilfe | Benutzerliste | Kalender | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
|
#1
|
|||
|
|||
|
Dmitry,
Could you please point out the prefered way to "manually" create a FCE (Ctype templavoila_pi1) based upon a given DS?. (manuall = from within an extension) I had a look at the TV API but couldnt find a function to create the pi_flexform field. Guess that happens somewhere in TCEMAIN. Any hints? Nikolas Hagelstein _______________________________________________ TYPO3-project-templavoila mailing list TYPO3-project-templavoila (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-templavoila |
|
#2
|
|||
|
|||
|
Hi Nikolas,
> Could you please point out the prefered way to "manually" create a FCE > (Ctype templavoila_pi1) based upon a given DS?. > (manuall = from within an extension) > > I had a look at the TV API but couldnt find a function to create the > pi_flexform field. Guess that happens somewhere in TCEMAIN. > Any hints? I would need the same thing and tracked down stuff until I got something: $destinationPointer = array( 'table' => 'pages', 'uid' => 35, 'sheet' => 'sDEF', 'sLang' => 'IDEF', 'field' => 'field_content', 'vLang' => 'vDEF', 'position' => 0, // insert at top 'targetCheckUid' => '', ); $newRow = array( 'CType' => 'templavoila_pi1', 'tx_templavoila_ds' => 2, 'tx_templavoila_to' => 2, ); $apiClassName = t3lib_div::makeInstanceClassName('tx_templavoila_a pi'); $apiObj = new $apiClassName('pages'); $newUid = $apiObj->insertElement($destinationPointer, $newRow); // $newUid contains the new uid of a FCE inserted into page 35. Now you may use this: $row = t3lib_BEfunc::getRecord('tt_content', 41); debug($apiObj->ds_getExpandedDataStructure('tt_content', $row)); That gives the DS of the FCE. You may then easily retrieve the list of fields from the structure and generate this: <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <T3FlexForms> <data> <sheet index="sDEF"> <language index="lDEF"> <field index="field_1"> <value index="vDEF"></value> </field> <field index="field_2"> <value index="vDEF"></value> </field> ... <field index="field_n"> <value index="vDEF"></value> </field> </language> </sheet> </data> </T3FlexForms> This is perhaps a way to investigate. -- Xavier Perseguers http://xavier.perseguers.ch/en _______________________________________________ TYPO3-project-templavoila mailing list TYPO3-project-templavoila (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-templavoila |
|
#3
|
|||
|
|||
|
Xavier Perseguers wrote:
>[creating manually] Yes that is how i do it atm but i thought there would be a more "elegant" way. Writing an empty record just to receive the datastructure seems a little odd to me .But thank you for sharing your approach ![]() Cheers, Nikolas _______________________________________________ TYPO3-project-templavoila mailing list TYPO3-project-templavoila (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-templavoila |
|
#4
|
|||
|
|||
|
>> [creating manually]
>> > Yes that is how i do it atm but i thought there would be a more "elegant" > way. > Writing an empty record just to receive the datastructure seems a little odd > to me .> But thank you for sharing your approach ![]() Yes, in my case I think I'll parse the flexform.xml file and generate the empty XML structure with %s placeholders for sprintf. This way, I'll be able to configure it within my extension. My investigations led me to being able to retrieve the XML that is sent to the tt_content editor, that is with field definition and comments and labels. I would nead to reverse-engineer the code used to save a user-filled-in flexform to the DB to be able to remove "in a clean way" the DS/TO but I think it's not worth my needs. I saw that Dmitry is there today, perhaps he'll give us a hint, if it's "easy" at all... -- Xavier Perseguers http://xavier.perseguers.ch/en/tutorials/typo3.html _______________________________________________ TYPO3-project-templavoila mailing list TYPO3-project-templavoila (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-templavoila |
|
#5
|
|||
|
|||
|
Xavier Perseguers wrote:
> Yes, in my case I think I'll parse the flexform.xml file and generate > the empty XML structure with %s placeholders for sprintf. This way, > I'll be able to configure it within my extension... Yes but it will become more complex when multible languages come into play :| Cheers, NIkolas _______________________________________________ TYPO3-project-templavoila mailing list TYPO3-project-templavoila (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-templavoila |
|
#6
|
|||
|
|||
|
Hi,
>> Yes, in my case I think I'll parse the flexform.xml file and generate >> the empty XML structure with %s placeholders for sprintf. This way, >> I'll be able to configure it within my extension... > > Yes but it will become more complex when multible languages come into play > :| No it won't because I was told once by Dmitry that it wasn't a good idea to use flexform integrated mechanism for localization as the flexform becomes more complicated, handling too and editors do not understand why sometimes they have to create additional translated records and page overlays, and sometimes they may configure all translations at once. But it's up to you. Cheers -- Xavier Perseguers http://xavier.perseguers.ch/en/tutorials/typo3.html _______________________________________________ TYPO3-project-templavoila mailing list TYPO3-project-templavoila (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-templavoila |
|
#7
|
|||
|
|||
|
Just putting this thread up again, hopping for Dmitry or someone else to
pop up ![]() Summary: How can someone (from an extension) dynamically create a new FCE? Nikolas seems to have the same problem than me and I'm not quite satisfied with my solution. I know I have a FCE with certain characteristics such as "3 columns of content". Somehow I can retrieve its record (till now only with a select when knowing something "static" such as the html filename it is based on, or its title). But then I would like to be able to create such tt_content element automatically, giving the "API" only a list of tt_content uid that should be placed in left, center and right column (in my example). Is it possible at all without hardcoding the flex code with placeholders in the extension? -- Xavier Perseguers http://xavier.perseguers.ch/en/tutorials/typo3.html _______________________________________________ TYPO3-project-templavoila mailing list TYPO3-project-templavoila (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-templavoila |
|
#8
|
|||
|
|||
|
Hi!
Xavier Perseguers wrote: > Is it possible at all without hardcoding the flex code with placeholders > in the extension? Since BE does it, it is certainly possible. But writing a guide how to make it will take lots of time. So I do not think this guide will appear any soon. -- Dmitry Dulepov TYPO3 Core team My TYPO3 book: http://www.packtpub.com/typo3-extens...velopment/book In the blog: http://typo3bloke.net/post-details/t...ng_in_eclipse/ _______________________________________________ TYPO3-project-templavoila mailing list TYPO3-project-templavoila (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-templavoila |
|
#9
|
|||
|
|||
|
Hi Dmitry,
Thanks for replying >> Is it possible at all without hardcoding the flex code with >> placeholders in the extension? > > Since BE does it, it is certainly possible. But writing a guide how to > make it will take lots of time. So I do not think this guide will appear > any soon. OK. Then I'll investigate a bit further. I already found a way to retrieve the commented flexform that is passed to the BE to dynamically create a form for the user. It seems that TCEmain shall become my friend ;-) -- Xavier Perseguers http://xavier.perseguers.ch/en/tutorials/typo3.html _______________________________________________ TYPO3-project-templavoila mailing list TYPO3-project-templavoila (AT) lists...netfielders.de http://lists.netfielders.de/cgi-bin/...ct-templavoila |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | Thema bewerten |
|
|
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| [TYPO3] How to manually uninstall an extension | Alessandro Vernet | typo3-english@lists.netfielders.de | 4 | 17.07.2008 23:31 |
| [TYPO3] Is it possible to install extensions manually,bypassing the EM? | The Plankmeister | typo3-english@lists.netfielders.de | 6 | 28.04.2008 21:27 |
| [TYPO3-dev] Manually rendering Content elements in BE | Jens Mittag | typo3-dev@lists.netfielders.de | 8 | 07.05.2007 16:58 |
| [TYPO3-dev] init FE environment manually | Christoph Koehler | typo3-dev@lists.netfielders.de | 2 | 21.02.2007 20:37 |
| [TYPO3-dev] Creating new content when also creating new page | Tapio Markula | typo3-dev@lists.netfielders.de | 0 | 13.12.2006 18:23 |