TYPO3Jack.net - Das TYPO3 Mailinglist Forum Archiv

TYPO3 Mailingliste: nicht fragen - lesen!

TYPO3 Mailingliste: nicht fragen - lesen!_RR_1-->
Zurück   TYPO3Jack.net - Das TYPO3 Mailinglist Forum Archiv > TYPO3-Mailinglists: ENGLISH > typo3-project-templavoila@lists.netfielders.de

Registrieren Hilfe Benutzerliste Kalender Suchen Heutige Beiträge Alle Foren als gelesen markieren
  #1  
Alt 29.07.2008, 13:16
Nikolas Hagelstein
Gast
 
Beiträge: n/a
Standard [TYPO3-templavoila] Creating FCE manually

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #2  
Alt 04.08.2008, 20:58
Xavier Perseguers
Gast
 
Beiträge: n/a
Standard Re: [TYPO3-templavoila] Creating FCE manually

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #3  
Alt 05.08.2008, 11:42
Nikolas Hagelstein
Gast
 
Beiträge: n/a
Standard Re: [TYPO3-templavoila] Creating FCE manually

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #4  
Alt 05.08.2008, 12:28
Xavier Perseguers
Gast
 
Beiträge: n/a
Standard Re: [TYPO3-templavoila] Creating FCE manually

>> [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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #5  
Alt 05.08.2008, 12:39
Nikolas Hagelstein
Gast
 
Beiträge: n/a
Standard Re: [TYPO3-templavoila] Creating FCE manually

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #6  
Alt 05.08.2008, 13:07
Xavier Perseguers
Gast
 
Beiträge: n/a
Standard Re: [TYPO3-templavoila] Creating FCE manually

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #7  
Alt 13.08.2008, 11:00
Xavier Perseguers
Gast
 
Beiträge: n/a
Standard Re: [TYPO3-templavoila] Creating FCE manually

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #8  
Alt 13.08.2008, 11:06
Dmitry Dulepov [typo3]
Gast
 
Beiträge: n/a
Standard Re: [TYPO3-templavoila] Creating FCE manually

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #9  
Alt 13.08.2008, 12:05
Xavier Perseguers
Gast
 
Beiträge: n/a
Standard Re: [TYPO3-templavoila] Creating FCE manually

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
 

Lesezeichen

Themen-Optionen
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an


Ähnliche Themen

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


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:05 Uhr.


Powered by vBulletin® Version 3.7.4 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Template-Modifikationen durch TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75