Feature #17874
closedAdd suggest-like feature to TCEforms
0%
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
}
- 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
Updated by Andreas Wolf almost 17 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 ;)
Updated by Jeff Segars almost 17 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.
Updated by Andreas Wolf almost 17 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!
Updated by Ingmar Schlecht almost 17 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
Updated by Daniel Poetzinger almost 17 years ago
+2
very nice
- "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.
Updated by Andreas Wolf almost 17 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.
Updated by Daniel Poetzinger almost 17 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);
Updated by Andreas Wolf almost 17 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...
Updated by Dmitry Dulepov almost 17 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...
Updated by Dmitry Dulepov almost 17 years ago
By the way, it can come to trunk-only.
Updated by Andreas Wolf almost 17 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 ;)
Updated by Andreas Wolf almost 17 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 ;)
Updated by Christoph Koehler almost 17 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.
Updated by Ingmar Schlecht almost 17 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.
Updated by Christoph Koehler almost 17 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.
Updated by Benni Mack almost 17 years ago
I added this to Target Version 4.3 so we don't forget about this cool feature!
Updated by Benni Mack over 15 years ago
should we look for an inclusion in 4.3 now?
Updated by Andreas Wolf over 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",
)
)
)
)
...);
Updated by Andreas Wolf over 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.
Updated by Steffen Müller over 15 years ago
uploaded version 7 published on the core-list on 09/06/26 by Andreas Wolf
Updated by Jonas Felix over 15 years ago
will this be in 4.3? that would be soo cool!!!
Updated by Steffen Müller over 15 years ago
Review is in progress. See core-list.
Updated by Andreas Wolf over 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.
Updated by Andreas Wolf about 15 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)
Updated by Rupert Germann about 15 years ago
FYI: committed to trunk rev 5902
(improved) Documentation has been uploaded to:
http://wiki.typo3.org/index.php/Pending_Documentation#doc_core_api
http://wiki.typo3.org/index.php/Pending_Documentation#doc_core_tsconfig