Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds ability to turn on/off autocompletion for 'pagetitle' field #14526

Open
wants to merge 1 commit into
base: 3.x
from

Conversation

Projects
None yet
4 participants
@DettRoxx
Copy link

commented Apr 2, 2019

What does it do?

Adds ability to turn on/off autocompletion for 'pagetitle' field with system setting resource_pagetitle_autocomplete

Why is it needed?

to avoid long sheet of available autocompletions

Related issue(s)/PR(s)

#6703

@DettRoxx DettRoxx requested review from Mark-H and opengeek as code owners Apr 2, 2019

@Alroniks
Copy link
Collaborator

left a comment

Need to apply some changes. Also, I am wondering, is it should be applied only for pagetitle field? What about longtitle and others?

@@ -634,6 +634,9 @@
$_lang['setting_resource_tree_node_name'] = 'Поле для названия узла в дереве ресурсов';
$_lang['setting_resource_tree_node_name_desc'] = 'Укажите поле ресурса, которое будет использоваться в качестве названия узла в дереве ресурсов. По умолчанию поле «pagetitle», любое поле ресурса может быть использовано: «menutitle», «alias», «longtitle», и т.п.';
$_lang['setting_resource_pagetitle_autocomplete'] = 'Включить автозаполнение для поля заголовка';

This comment has been minimized.

Copy link
@Alroniks

Alroniks Apr 3, 2019

Collaborator

It should be removed from the pull request, all strings will be translated via Crowdin.

Ext.ComponentMgr.onAvailable("modx-resource-pagetitle", function(field) {
var setting_pagetitle_autocomplete = +MODx.config.resource_pagetitle_autocomplete;
var autocomplete = setting_pagetitle_autocomplete ? "on" : "off";
field.defaultAutoCreate = {tag: "input", type: "text", size: "20", autocomplete: autocomplete, msgTarget: 'under' }

This comment has been minimized.

Copy link
@Alroniks

Alroniks Apr 3, 2019

Collaborator

Why the size is 20?

This comment has been minimized.

Copy link
@DettRoxx

DettRoxx Apr 3, 2019

Author

I copied from here (default code of modx.js)
image

and change only logic for autocomplete

This comment has been minimized.

Copy link
@DettRoxx

DettRoxx Apr 3, 2019

Author

i think (if we can write more than 20 characters in pagetitle field - 'size' is only default, but overrides by ExtJS for every field with strict 'size' option)

@@ -625,6 +625,9 @@
$_lang['setting_resource_tree_node_name'] = 'Resource Tree Node Field';
$_lang['setting_resource_tree_node_name_desc'] = 'Specify the Resource field to use when rendering the nodes in the Resource Tree. Defaults to pagetitle, although any Resource field can be used, such as menutitle, alias, longtitle, etc.';
$_lang['setting_resource_pagetitle_autocomplete'] = 'Enables autocomplete for pagetitle field';
$_lang['setting_resource_pagetitle_autocomplete_desc'] = 'Select \'Yes\' if you want to see hints/autocomplete data based on the previous entered values for the pagetitle field of the resource.';

This comment has been minimized.

Copy link
@Alroniks

Alroniks Apr 3, 2019

Collaborator

Could you change quotes to " for "Yes" or rephrase the string to avoid issues with backslashed symbols?

This comment has been minimized.

Copy link
@DettRoxx

DettRoxx Apr 3, 2019

Author

i take example as 'standart' from here, here single quotes with backslash
image

This comment has been minimized.

Copy link
@Alroniks

Alroniks Apr 3, 2019

Collaborator

I understand, but the existing code does not mean automatically that it is correct. Those string also should be fixed in the future.

@Ruslan-Aleev

This comment has been minimized.

Copy link
Contributor

commented Apr 3, 2019

An interesting issue, but narrowly focused :) Maybe we need to make the setting for all fields of the resource, as suggested earlier, or even the fields of the elements?
p.s. Although autocomplete never bothered me.

@DettRoxx

This comment has been minimized.

Copy link
Author

commented Apr 3, 2019

Yes, sounds good. Like 'exclude templates' in ms2Gallery, but for fields. I'll try to change logic to this functionality

@JoshuaLuckers

This comment has been minimized.

Copy link
Collaborator

commented May 5, 2019

Having a setting to turn off autocompletion for the page title alone is fine. We don't need to enable/disable autocompletion for the other fields (and if we do create new PR's for them).

If you need any help solving the requested changes please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.