Custom CTypes: Position in type dropdown - typo3

Is there a "quick" way to change the sort order of new content elements in the type dropdown? It seems, that new content elements are pushed to the end of the array, so they appear at the end of the list.
Current position (at the end of list):
Should be:
At the end of group "Standard".
Question:
Is is possible to register a content element to a specific group like "Standard" or "Lists" or a new group?
P.S.: Content element registered correctly in TCA/Overrides/tt_content and in Page TS Config for Wizard. Let me know if the code should be relevant, I will add it then.

Try out ExtensionManagementUtility::addTcaSelectItem() and see argument #3 and #4.
If I want to add a custom group at a certain position, I usually loop over $GLOBALS[TCA][tt_content][CType][config][items] and place it in the right position, if the API is not sufficient in some cases.

You can add new groups using ExtensionManagementUtility::addTcaSelectGroup().
For example,
ExtensionManagementUtility::addTcaSelectItemGroup(
'tt_content', 'CType', 'my_new_group', 'Label for my group', 'after:default');
Other possibilities for position are before:some_group_id, bottom, and top.
Then there is an optional fourth array value in the $item parameter for ExtensionManagementUtility::addTcaSelectItem() which allows you to specify which group you are adding to.
The fourth and fifth parameters to addTcaSelectItem() allow you to specify a position relative to another item in the drop-down.
ExtensionManagementUtility::addTcaSelectItem(
'tt_content', 'CType',
['Label for my item', 'my_new_item', 'my-item-icon', 'my_new_group'],
'some_other_item', 'after');
The "Standard" group is called default. If you reuse an existing group ID, addTcaSelectItemGroup() will return without changing anything.

Related

In Azure DevOps, is there a way to hide Iteration and Area fields in custom work item types?

In Azure Devops, using Customize option, you can add/modify fields except the Title, State, Reason, Area, Iteration Path. Is there a way I can modify a custom work item type to remove these fields as well?
No, these are system fields. There are headers elements that we'll have on each work item type:
Fields: Work item ID, Title, Assigned To, State, Reason, Area Path,
Iteration Path, and tags
Pages: History page, Links page
, and Attachments page.
Is there a way I can modify a custom work item type to remove these
fields as well?
System controls like Area Path, Iteration Path and Reason can be hidden from work item form using Rest API. In additon to hide them, lables to these controls can also be edited. You can not hide Title and State. Here are the steps:
Get the process ID
Get https://dev.azure.com/{Organization} /_apis/work/processes?api-version=6.0-preview.1
Update a System Control
PATCH https://dev.azure.com/{organization}/_apis/work/processes/{processId}/workItemTypes/{witRefName}/layout/systemcontrols/{controlId}?api-version=6.0-preview.1
Request Body:
{
"visible": false
}
Result:

Gravity Form->Select Field->Add Option

So Gravity List has a great option in its Drop Down User Interface that let's you add by typing a new option, kinda like an "other" option.
Gravity List Field-Drop Down Option
I want to do this with a normal Drop Down. Thoughts?
You can create a dropdown that is dynamically populated with taxonomy terms, including a term called "other".
When the "other" select option is chosen, conditional logic to a single line text field that will create a new taxonomy term on form submission.
On next use of the form, the dynamic list will have your new single line term too.
Keep using the "other" conditional route to add new options to select.

Remove "empty" selection from dropdown list box

When creating a form in Orbeon Form Builder, you can define a list of values for a dropdown list box.
When running the form in form runner, is it possible to remove the "[Select...]" value from this dropdown list box?
I would like to restrict the possible values only to the given ones and restricting the user from selecting an "[Select...]" value when filling in the form. I hope you understand what I mean :)
Here is a screenshot
It's not possible without changes to Orbeon Forms to remove the empty option.
The best way to achieve what you want is to make the field required. When that's the case, the user will have to select a value or validation won't pass.
(The rationale for adding/keeping an empty option at the top is to force the user to make a selection. Otherwise it is possible that users might not even look at the option selected by default, and involuntarily select an incorrect option.)

Drupal 7 Views add list of authors as exposed filter

I have a view with a number of exposed filters that I want to add an exposed filter for the author, so that the user can limit a list of nodes by the creator of the node (in addition to a number of other filters).
What I've done so far:
I've added an exposed filter of the author and set the operator to "contains any word" (so the usernames could just be a + separated list)
This is by default a text field, but I would like it to appear as a list of checkboxes (similar to taxonomy)
Using hook_form_alter I've added the following code to change it to a list of checkboxes (harcoded for now but I'll fix shortly)
$form['name']['#type'] = "select";
$form['name']['#size'] = "3";
$form['name']['#multiple'] = TRUE;
$form['name']['#options'] = array(
'admin' => 'admin',
'tyler' => 'tyler',
'test' => 'test'
);
$form['name']['#theme'] = "select_as_checkboxes";
When this form is submitted it changes the url to &name[]=tyler&name[]=admin, what I would like to do is combine these with a foreach so that url would look like &name=tyler+admin, but I'm really not sure how exactly to achieve this in the API.
I tried adding a function to $form['#submit'], and changing the value of the field in there, but that still didn't change the output.
Any advice?
Quick Edit
For the time being I have switched this to use radios instead of checkboxes, which solves the issue that I was having.
To break down the issue I was having a bit further, the names of the checkboxes where getting set to name[]= instead of name= because of the multiple inputs. The name filter in Views does not know how to handle multiple values for the name field.
For now I will see if this flies with the client, but if anybody has an answer for the original question of adding checkboxes for all authors to an exposed filter that would be awesome!
Use Better Exposed Filters module.

How to put settings into groups

I am having issues with the settings bundle on iPhone. I want to create groups like shown in the image below (Measurement, Data Entry..etc.), however I can't work out how to do this.
I have found the 'Item' type 'Group' and I know how to create the individual settings, I just can't figure out how to put them into a group.
You should just have to specify an Item0 (Title = Measurement, Type = Group) then all the subsequent entries after that (Item1, Item2, etc) will be added under that group. This can all be entered in the plist editor of Xcode.
One thing to note is all items you add will appear under that group until you specify a new group.
Refer to the image attached.