TCE in FE

View: New views
12 Messages — Rating Filter:   Alert me  

TCE in FE

by Dan Osipov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm wondering if anyone ever looked at utilizing TCE in the front end? I
would like to have FE users create records, that would benefit from TCE
hooks.

Is it possible by emulating a BE user? Anyone got any experiences with this?

--
Dan Osipov
Calkins Media
http://danosipov.com/blog/
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

Re: TCE in FE

by Dmitry Dulepov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

Dan Osipov wrote:
> I'm wondering if anyone ever looked at utilizing TCE in the front end? I
> would like to have FE users create records, that would benefit from TCE
> hooks.
>
> Is it possible by emulating a BE user? Anyone got any experiences with
> this?

There is (was?) a class named something like xxx_tcefe. Have a look.

--
Dmitry Dulepov
Facebook: http://www.facebook.com/dmitryd
Twitter: http://twitter.com/dmitryd
Skype: liels_bugs
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

Re: TCE in FE

by Bernhard Kraft-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dan Osipov schrieb:
> I'm wondering if anyone ever looked at utilizing TCE in the front end? I
> would like to have FE users create records, that would benefit from TCE
> hooks.

Hello!

There are two approaches utilizing "tcemain" - and another one which is
also quite common for TYPO3.

*1*
Create an instance of the normal t3lib_tcemain class, and initialize a
temporary BE-user class "t3lib_beuserauth". If you want to know how this
is done, have a look at my (obsolete) extension kb_shop in method:
pi1/class.tx_kbshop_pi1.php:loadTable (search for "tempBE_USER"). In
method "loadTable" the faked BE_USER record gets initialized.

Search for other occurences of "BE_USER" to get a glimpse how it is used
in interaction with "t3lib_TCEforms"


*2*
There is a class:
typo3/sysext/cms/tslib/class.tslib_fetce.php (tslib_feTCE)

I did not use it until now - but this should be what you want ;)


*3*
Both previous methods, require you to write additional PHP code. The
other solution would be to user "fe_userAdmin". This is an old
library/script written by Kasper. But I use it since I work with TYPO3
(2003) to create "fe_user", "tt_address" and any other kind of records
created by users.

The documentation is here:
http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.2.1/view/1/11/#id4592033

Have a look at the templates of the extensions "feuser_admin" or
"direct_mail_subscription". Of course these are just examples of
creating "fe_user" or "tt_address" records.

In your cause you would most probably change the TypoScript parameter
"table" of the plugin to match the name of your table.

BTW: If you ever wondered what the "TCA['tablename']['feInterface']"
value in TCA is for: It lists the fields which are allowed to get
modified from within the FE.



Does that answer your question?


greets,
Bernhard
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

Re: TCE in FE

by Martin Kutschker-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bernhard Kraft schrieb:
>
> *3*
> Both previous methods, require you to write additional PHP code. The
> other solution would be to user "fe_userAdmin". This is an old
> library/script written by Kasper. But I use it since I work with TYPO3
> (2003) to create "fe_user", "tt_address" and any other kind of records
> created by users.

IMHO any of the "form handling" and "(user) registration" extension do a better job.

Masi
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

Re: TCE in FE

by Dan Osipov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for a detailed answer! I was leaning towards the first solution,
but didn't know about the others. I'll take a look to see which one
would work best.

In my scenario, I am mostly concerned about the TCE hooks - there are
lots of them, and I would like to keep them operational, even if the
record is created from the FE.

Dan Osipov
Calkins Media
http://danosipov.com/blog/

Bernhard Kraft wrote:

> Dan Osipov schrieb:
>> I'm wondering if anyone ever looked at utilizing TCE in the front end? I
>> would like to have FE users create records, that would benefit from TCE
>> hooks.
>
> Hello!
>
> There are two approaches utilizing "tcemain" - and another one which is
> also quite common for TYPO3.
>
> *1*
> Create an instance of the normal t3lib_tcemain class, and initialize a
> temporary BE-user class "t3lib_beuserauth". If you want to know how this
> is done, have a look at my (obsolete) extension kb_shop in method:
> pi1/class.tx_kbshop_pi1.php:loadTable (search for "tempBE_USER"). In
> method "loadTable" the faked BE_USER record gets initialized.
>
> Search for other occurences of "BE_USER" to get a glimpse how it is used
> in interaction with "t3lib_TCEforms"
>
>
> *2*
> There is a class:
> typo3/sysext/cms/tslib/class.tslib_fetce.php (tslib_feTCE)
>
> I did not use it until now - but this should be what you want ;)
>
>
> *3*
> Both previous methods, require you to write additional PHP code. The
> other solution would be to user "fe_userAdmin". This is an old
> library/script written by Kasper. But I use it since I work with TYPO3
> (2003) to create "fe_user", "tt_address" and any other kind of records
> created by users.
>
> The documentation is here:
> http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.2.1/view/1/11/#id4592033
>
> Have a look at the templates of the extensions "feuser_admin" or
> "direct_mail_subscription". Of course these are just examples of
> creating "fe_user" or "tt_address" records.
>
> In your cause you would most probably change the TypoScript parameter
> "table" of the plugin to match the name of your table.
>
> BTW: If you ever wondered what the "TCA['tablename']['feInterface']"
> value in TCA is for: It lists the fields which are allowed to get
> modified from within the FE.
>
>
>
> Does that answer your question?
>
>
> greets,
> Bernhard
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

Re: TCE in FE

by Mathias Schreiber [wmdb >] :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Martin Kutschker schrieb:
> Bernhard Kraft schrieb:
>> *3*
>> Both previous methods, require you to write additional PHP code. The
>> other solution would be to user "fe_userAdmin". This is an old
>> library/script written by Kasper. But I use it since I work with TYPO3
>> (2003) to create "fe_user", "tt_address" and any other kind of records
>> created by users.
>
> IMHO any of the "form handling" and "(user) registration" extension do a better job.

in terms of ... ?
just curious

--
TYPO3 certified interogator
T3DD09 Entertainer
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

Re: TCE in FE

by Bernhard Kraft-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mathias Schreiber [wmdb >] schrieb:

> Martin Kutschker schrieb:
>> Bernhard Kraft schrieb:
>>> *3*
>>> Both previous methods, require you to write additional PHP code. The
>>> other solution would be to user "fe_userAdmin". This is an old
>>> library/script written by Kasper. But I use it since I work with TYPO3
>>> (2003) to create "fe_user", "tt_address" and any other kind of records
>>> created by users.
>>
>> IMHO any of the "form handling" and "(user) registration" extension do
>> a better job.
>
> in terms of ... ?
> just curious

Nice to read other people also still use this "relict" library. I hope
this is what you meant Mathias?

I often tought it would need a few updates and get a little bit
revamped. Like cObjects in more places, better handling of
database-relation fields, etc. But it does what it should since quite a
long time ;)

Which "form handling" extensions were you talking about Masi? Some of
them are quite new, like "formhandler". But I somehow fear at looking at
those enormous amount of classes (about 30) each only a few KB large.


I mean no real problem. But I do not see where this new "homoeopathy"
style comes frome, do "dilute" all functionality into tens of classes.
?!?!? *what-the-heck*

I do not really think this makes anything better ... But if I am wrong
and there is some reason for this programming paradigm please correct me!!!


greets,
Bernhard
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

Re: TCE in FE

by Ingmar Schlecht :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dan Osipov schrieb:
> I'm wondering if anyone ever looked at utilizing TCE in the front end? I
> would like to have FE users create records, that would benefit from TCE
> hooks.
>
> Is it possible by emulating a BE user? Anyone got any experiences with
> this?

One possibility is also to use the timtaw extension which basically
offers a way to use tceforms in the FE.

http://typo3.org/extensions/repository/view/timtaw/current/

Don't be mislead by the name, it acutally isn't a wiki but just that: A
way to use TCE forms in the frontend. No idea if it's still working
though ;-)

cheers
Ingmar
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

Re: TCE in FE

by Martin Kutschker-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bernhard Kraft schrieb:

> Mathias Schreiber [wmdb >] schrieb:
>> Martin Kutschker schrieb:
>>> Bernhard Kraft schrieb:
>>>> *3*
>>>> Both previous methods, require you to write additional PHP code. The
>>>> other solution would be to user "fe_userAdmin". This is an old
>>>> library/script written by Kasper. But I use it since I work with TYPO3
>>>> (2003) to create "fe_user", "tt_address" and any other kind of records
>>>> created by users.
>>> IMHO any of the "form handling" and "(user) registration" extension do
>>> a better job.
>> in terms of ... ?
>> just curious
>
> Nice to read other people also still use this "relict" library. I hope
> this is what you meant Mathias?
>
> I often tought it would need a few updates and get a little bit
> revamped. Like cObjects in more places, better handling of
> database-relation fields, etc. But it does what it should since quite a
> long time ;)

I used it only once for a project using TYPO3 3.5 and - sorry to say - I think it sucked. Just to
name a few problems: it doesn't distinct between validating a field and making it a required field -
just like TCA *grrrr* :( AFAIR you cannot update an upload field in a subsequent "edit view" of the
form.

Actually the shortcomings weren't so many. But it took me too many hoops to fix them. In the end the
code was so messy (and entangled with features I needed only for the site) I had no chance to
present my changes to the community. Though at this time there was no Core team. So I'd had to
bugger Kasper himself.

Masi
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

Re: TCE in FE

by Mathias Schreiber [wmdb >] :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Martin Kutschker schrieb:
>>> in terms of ... ?
>>> just curious
>> Nice to read other people also still use this "relict" library. I hope
>> this is what you meant Mathias?

Never saw a faster way to subscribe to a newsletter or to update small
things in a record.
Every external extension loaded is overhead.
But: I am very picky about performance, so I might not be really
representative :)

> I used it only once for a project using TYPO3 3.5 and - sorry to say - I think it sucked. Just to
> name a few problems: it doesn't distinct between validating a field and making it a required field -
> just like TCA *grrrr* :( AFAIR you cannot update an upload field in a subsequent "edit view" of the
> form.

hm.
This f course is determined by the way you approach things.
I mostly say: "It is required to pt in a valid email address"
Other might do otherwise.

> Actually the shortcomings weren't so many. But it took me too many hoops to fix them. In the end the
> code was so messy (and entangled with features I needed only for the site) I had no chance to
> present my changes to the community. Though at this time there was no Core team. So I'd had to
> bugger Kasper himself.

*Wir ur-gestein haben's schon schwer*

;-)


--
TYPO3 certified interogator
T3DD09 Entertainer
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

Re: TCE in FE

by Bernhard Kraft-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Martin Kutschker schrieb:

> I used it only once for a project using TYPO3 3.5 and - sorry to say
> - I think it sucked. Just to name a few problems: it doesn't distinct
> between validating a field and making it a required field - just like
> TCA *grrrr* :( AFAIR you cannot update an upload field in a
> subsequent "edit view" of the form.

I do not really understand what problem you had with validate/require a
field. This always worked seemlessly for me.

But the thing about not being able to re-upload a file (editing the
file-field of an already existing record) also bothered me quite some
times. But I think I have found a quite good solution for this. I'll put
it on my todo list - probably I'll send a patch for this problem to the
core list.
(My solution just collects all "replaced" files in an array. And when
the script finishes and updates the record, those old unneeded files get
unlinked)


> Actually the shortcomings weren't so many. But it took me too many
> hoops to fix them. In the end the code was so messy (and entangled
> with features I needed only for the site) I had no chance to present
> my changes to the community. Though at this time there was no Core
> team. So I'd had to bugger Kasper himself.

This is also what my problem is/was until now. AFAIR I once posted a
patch request to the core list some years ago. But I think I just did
not take any further care.


greets,
Bernhard
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

Re: TCE in FE

by Martin Kutschker-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bernhard Kraft schrieb:

> Martin Kutschker schrieb:
>
>> I used it only once for a project using TYPO3 3.5 and - sorry to say
>> - I think it sucked. Just to name a few problems: it doesn't distinct
>> between validating a field and making it a required field - just like
>> TCA *grrrr* :( AFAIR you cannot update an upload field in a
>> subsequent "edit view" of the form.
>
> I do not really understand what problem you had with validate/require a
> field. This always worked seemlessly for me.

Maybe I don't recall things correctly, but I remeber that I couldn't validate a field if it wasn't
required. But my memory is dim. I simply didn't like this lib.

>> Actually the shortcomings weren't so many. But it took me too many
>> hoops to fix them. In the end the code was so messy (and entangled
>> with features I needed only for the site) I had no chance to present
>> my changes to the community. Though at this time there was no Core
>> team. So I'd had to bugger Kasper himself.
>
> This is also what my problem is/was until now. AFAIR I once posted a
> patch request to the core list some years ago. But I think I just did
> not take any further care.

Maybe you can find some friends of this lib who give you +1 for your patches. It won't be me ;)

Masi
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev@...
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev