Project

General

Profile

Actions

Feature #17874

closed

Add suggest-like feature to TCEforms

Added by Andreas Wolf over 16 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2007-12-02
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.1
Tags:
Complexity:
Sprint Focus:

Description

The current way of inserting records into relation-fields is quite complicated - you have to open the element browser, go your way to the page where the record is stored and insert it. This can be really time-consuming, especially when having a deeply nested, complicated structure of pages.

This patch adds a feature like seen in Google suggest or other applications. When enabled, it displays an input field below (and - planned - right to) the list of related records. See the attached screenshot for an example.
The feature uses script.aculo.us to display the selector and an extended version of alt_doc_ajax.php originally made by Oliver Hader.

To test it, apply the attached patch to TYPO3 4.1.x or 4.2-dev. The patch has been made against 4.1, but it also applies to trunk without any serious hassle.
Then install the extension demo_ajaxselect, which is also attached to this report. Insert a record of type "Demo record for AJAX selector" to have a record with two ajax-capable fields. You also have to add the following configuration to TSconfig (some of it should be set by default when this patch gets into core):

TCEMAIN {
default.ajaxSelector { # limits the selection to page 1 and its subpages
pid = 1 # sets the default renderlet for all records
AJAXclass = ajax_select
}

pages.ajaxSelector {
  # only select the subpages of the pid defined above when selecting pages
  # other records will still be fetched from all subpages
pidDepth = 0
}
  1. define some alternative settings for the extensions a21glossary and party
    tx_a21glossary_main.ajaxSelector {
    AJAXclass = tx_a21glossary_ajaxselect
    pid = 23
    }
    tx_party_parties.ajaxSelector {
    AJAXclass = tx_party_ajaxselect
    }
    }

IMPORTANT: To be able to fully test the extension, please install a21glossary and party (from typo3xdev SVN).

(issue imported from #M6872)


Files

ajaxselector.png (25.8 KB) ajaxselector.png Administrator Admin, 2007-12-02 14:41
group_suggest.gif (97 Bytes) group_suggest.gif Administrator Admin, 2007-12-30 21:25
T3X_demo_ajaxselect-0_0_0-z-200801201834.t3x (11.7 KB) T3X_demo_ajaxselect-0_0_0-z-200801201834.t3x Administrator Admin, 2008-01-20 18:33
suggest_v3.diff (31.8 KB) suggest_v3.diff Administrator Admin, 2008-01-20 18:34
suggest_v4.diff (32.8 KB) suggest_v4.diff Administrator Admin, 2008-01-28 12:05
suggest_v5.diff (38.9 KB) suggest_v5.diff Administrator Admin, 2009-05-20 00:16
T3X_demo_ajaxselect-0_0_0-z-200905200017.t3x (11.7 KB) T3X_demo_ajaxselect-0_0_0-z-200905200017.t3x Administrator Admin, 2009-05-20 00:17
tceforms-suggest-v6.patch (34 KB) tceforms-suggest-v6.patch Administrator Admin, 2009-06-15 15:38
0006872_tceforms-suggest-v7.diff (68.4 KB) 0006872_tceforms-suggest-v7.diff Administrator Admin, 2009-06-26 11:03
0006872_tceforms-suggest-v8.diff (69.3 KB) 0006872_tceforms-suggest-v8.diff Administrator Admin, 2009-07-23 09:56
0006872_tceforms-suggest-v9.diff (69.8 KB) 0006872_tceforms-suggest-v9.diff Administrator Admin, 2009-09-03 22:51
0006872_tceforms-suggest-v8-to-v9.diff (1.86 KB) 0006872_tceforms-suggest-v8-to-v9.diff Administrator Admin, 2009-09-03 22:51

Related issues 7 (0 open7 closed)

Related to TYPO3 Core - Bug #21036: Use suggest feature in system extensionsClosedRupert Germann2009-09-11

Actions
Related to TYPO3 Core - Bug #21034: Use suggest feature in coreClosedSteffen Kamper2009-09-11

Actions
Related to TYPO3 Core - Bug #21026: TCEforms suggest fails with empty label or label_alt fieldClosedRupert Germann2009-09-10

Actions
Related to TYPO3 Core - Bug #21061: TCEforms suggest sometimes uses incorrect permissions to show recordsClosed2009-09-15

Actions
Related to TYPO3 Core - Bug #21924: suggest wizard does not work properly with TCA fields of type "select"ClosedTolleiv Nietsch2010-01-07

Actions
Related to TYPO3 Core - Bug #21342: Improve TCEforms SuggestClosed2009-10-22

Actions
Related to TYPO3 Core - Bug #21723: "find record" search filed for web site users and groupsClosed2009-11-27

Actions
Actions #1

Updated by Andreas Wolf over 16 years ago

A minor ;) thing I forgot: This version of the patch is not ready for submission to core, it is just to test and give feedback. For core I will still have to clean the whole thing up - and integrate lots of ideas ;)

Actions #2

Updated by Jeff Segars over 16 years ago

Thanks Andreas! I was able to test this and overall it works well for me. I'm very excited to see this progress and get into the core.

Actions #3

Updated by Typoheads GmbH over 16 years ago

good idea. +1

Actions #4

Updated by Andreas Wolf over 16 years ago

A new version of my patch with two new features: The selector is now hideable by default and it may be placed below or right to the record list.

I still have to make the style configurable (e.g. show no icons) and enable configuration on a per-field base.

Please test and give feedback!

Actions #5

Updated by Ingmar Schlecht over 16 years ago

Hi Andreas,

I briefly had a look at your patch, looks good so far.

Could you write a patch to the kickstarter as well that adds a way to enable the new option for group fields created with the kickstarter (along with a screenshot of the new feature)? The Kickstarter SVN is available at https://typo3xdev.svn.sourceforge.net/svnroot/typo3xdev/tx_kickstarter/

cheers
Ingmar

Actions #6

Updated by Daniel Poetzinger over 16 years ago

+2
very nice

some small details:
  • "Find record: " should be a language label.
  • limit is hardcoded to 50 - maybe its possible to make it part of TCA config.

BTW: I read the comment "Have to do it this way because of the crude t3lib_div::makeInstance"
there is also makeInstanceClassName - so its possible to use constructor as well.

Actions #7

Updated by Andreas Wolf over 16 years ago

Ingmar, I will try to manage to do it until next week so I can also submit it to the core list. Thanks for the idea, I didn't think of that.

Daniel, thanks for your comments. I will move the hardcoded label to LLL and I will try to make the limit configurable. But do you think this makes sense? It is just a rough estimate I did on how many records usually will be neccessary to get ten usable ones - for admins of course you need less, but for users with very limited access to a large system this will not be enough. I thought 50 to be a good compromise to save resources (RAM) and minimize db queries.
I fear I can't do anything about the constructor - I need to pass additional parameters to init(), so I can't use the constructor because passing parameters is not supported by makeInstance, at least as far as I know.

Actions #8

Updated by Daniel Poetzinger over 16 years ago

to the 50 limit: sounds ok.

construtors can be used this way: (but no matter there are so much init functions in the core ;-))
$className=makeInstanceClassName ('someclass');
$class=new $className($someRequiredParameters);

Actions #9

Updated by Andreas Wolf over 16 years ago

Ah, that's too easy ;) I really didn't think of that - don't ask me why... I'll change this later on, using init() is really strange and makes using the class more complex than it has to be...

Actions #10

Updated by Dmitry Dulepov over 16 years ago

If this patch is ready for integration to core, it should be posted to core list ASAP. We are close to alpha3. After alpha3 all new features will be frozen and you'll have to wait a year for next TYPO3 version to get this patch in...

Actions #11

Updated by Dmitry Dulepov over 16 years ago

By the way, it can come to trunk-only.

Actions #12

Updated by Andreas Wolf over 16 years ago

I created a new version of the patch against trunk, with some code-cleanups as suggested on the core list.

This new patch has already been posted on the core list, so please give your +1s there ;)

Actions #13

Updated by Andreas Wolf about 16 years ago

Jeff Segars has reported a problem when there is no pid limit. I have corrected this and uploaded a new patch (suggest_v4.diff). Please test again and give feedback ;)

Actions #14

Updated by Christoph Koehler about 16 years ago

I am Christoph Koehler, developer of wec_people formerly known as party.
I would like to use this feature to make handling of large record sets easier. Right now, if I want to make a select field to pick related records from, and we have thousands of records, the backend takes a long time to load the record.
So I would like to use an input field that has the suggested records, but it looks like it can't do that for input fields right now.
I am willing to help do that, just wanted to get this request out there for people to discuss.

Actions #15

Updated by Ingmar Schlecht about 16 years ago

@christoph - (and to everyone else interested in getting this into the core):
If you want to help getting this committed, please subscribe to the core team mailinglist and give your +1 voting after properly and intensively testing the patch.

This is the only way we can get it into 4.2.

See http://typo3.org/teams/core/core-mailinglist-rules/ for details on how to join the core team list.

Actions #16

Updated by Christoph Koehler about 16 years ago

I am already subscribed to the core list and will give my +1 soon :)
I just posted this here because I would need some more functionaility than there currently is and am offering my help.

Actions #18

Updated by Benni Mack about 16 years ago

I added this to Target Version 4.3 so we don't forget about this cool feature!

Actions #19

Updated by Benni Mack about 15 years ago

should we look for an inclusion in 4.3 now?

Actions #20

Updated by Andreas Wolf almost 15 years ago

I posted a new version of the patch and the demo extension. There are two major changes: The configuration may now be fully done in TCA, so no TSconfig is required by default, even for non-standard settings.

The second change is that the suggest box now is implemented as a TCEforms wizard. This also changes the configuration in TCA, to e.g. this:

$TCA["tx_demoajaxselect_demo"]["columns"]["aSampleColumn"]["config"] = array( ...,
"wizards" => array(
"suggest" => array(
"type" => "suggest",
"config" => array(
"tx_a21glossary_main" => array(
"suggestClass" => "tx_a21glossary_ajaxselect",
)
)
)
)
...);

Actions #21

Updated by Andreas Wolf almost 15 years ago

I just uploaded the latest version of the patch, polished by Benni Mack and pending in the core list. I will also have a closer look at it later on.

Actions #22

Updated by Steffen Müller almost 15 years ago

uploaded version 7 published on the core-list on 09/06/26 by Andreas Wolf

Actions #23

Updated by Jonas Felix almost 15 years ago

will this be in 4.3? that would be soo cool!!!

Actions #24

Updated by Steffen Müller almost 15 years ago

Review is in progress. See core-list.

Actions #25

Updated by Andreas Wolf almost 15 years ago

Uploaded a new version 8 of the patch, with these new features: Custom ordering of records, configurable maximum number of items on the list.

Fixes: Depth limiting and recursive search now work correctly.

Actions #26

Updated by Andreas Wolf over 14 years ago

I uploaded a new version 9 of the patch, with two changes:

  • label_alt is now also supported in addition to label
  • items with long titles or paths (i.e., when they span over multiple lines) are now also supported (this was just a small CSS change)
Actions

Also available in: Atom PDF