Hi! I want custom field data, because I have many arrays in one array.
I try using field: 'LeftNavigation.Title' but it didn't work.
You can't using multi Array data in field
Maybe you should choose another solution for this
Suggest : Create Leftnavigation Field , when click on this field it's show a second table show data from Leftnavigation array
Related
I'm trying build a custom filter based on a string field. In my case I try map a field "nome_setor" in other table. If I try use variable with a text field works fine:
If I change this for a custom field using another table not works. In this case not show the filter:
Thank you in advance.
You can't use custom fields when you compare it values with some other column.
For you case to work, remove the table alias from the custom field you gonna use, and define your conditional snippet like so:
[[AND {{hithere}}]]
Now when you select the custom field, it should work. But you LIKE won't.
Hope it helps
I'm trying to work with the bundles :
https://github.com/lexik/LexikFormFilterBundle
https://github.com/stephanecollot/DatetimepickerBundle
So I've a filed of my form with to apply a filter acordin to this field
->add('fecha', 'filter_date_range');
Now I wanna add another parameter because this field is a data then I wanna see a datapicker so I need to apply another parameter here like
->add('fecha', 'filter_date_range collot_datetime');
But this not works so, are there some way to implements the both bundles in a field?
This can not be done out of the box - field can have only one type.
If you need to customize form field type you can create your own: http://symfony.com/doc/current/cookbook/form/create_custom_field_type.html (based on these two)
Context: Content type Person has reference (multiple values) to a content type Work, using entity reference.
Need: To display the title of each person node which references a given work, separated by a comma.
Done: A view with a back reference, the right nodes are fetched. (Views 7.x-3.7)
Problem: Cannot display the value separated by a comma. Note: I usually do it with the "Simple separator" display type which is under "Display all values in the same row" in the MULTIPLE FIELD SETTINGS field group. However, this field group is not available in my context.
Solved
I have found the module Views Merge Rows - works very nice. If it does not support Features module for some reason, I can take some of its code code in order to use hook_views_pre_render myself.
I was able to work around this problem by using token_formatters. The basic steps (after token formatters is installed):
No relationship to referenced entity in views (not needed)
Add the entity reference field to the view
Change formatter to "tokenized text"
For 'Text to output' use a token (I'm using [node:field-name])
For 'link destination' use a token ('m using [entity:url:path] for a relative link)
Set multiple field setting as desired
You need a custom views Format here because you are talking about the whole views-row not a multiple results field. You can use the "Unformatted list" and add a comma to be added with CSS or JS.
What kind of Relationship do you use? Can you export your whole views in an external editor and provide a link?
I had a similar issue, where I was using the Entity Reference relationship of "Referencing Entity" instead of "Referenced Entity". (The reference was on the child and the View started at the parent level).
When you run a Drupal System Message on the row (dsm), it returns all the nid responses appropriately, but as different result rows instead of as a single object; however, since the NID field (like many others) has no option for display multiple results, it would only grab the first result.
I ended up having to do an Entity Query from a Views PHP field with the current row's NID as one of the Field Conditions. That seemed to do the trick, rather than trying to load a View inside of a View with views_field_view.
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node')
->entityCondition('bundle', '[your_content_type]')
->propertyCondition('status', 1)
->fieldCondition('[your_field_machine_name]', '[field_column_to_check]', $row->nid)
->addMetaData('account', user_load(1)); // Run the query as user 1.
$result = $query->execute();
I had a very similar problem: no "Multiple Field Settings" were available in the field configuration of a multi-value entity reference from my content type to User.
Solved it by removing the entity reference and instead using the multi-value "User ID" field of my content type directly. The "Multiple Field Settings" form area was available now and I selected "Display all values in the same row" there as you do normally. Now this would only display numeric user IDs separated by comma (not desired). But in the field configuration there was also a setting "Format:", which I set to "Label". This would display user names instead.
So I guess by creating a custom formatter you would be able to display your associated "Work" entities in a similar way.
With Symfony2, i use "FOSuserBundle". In my Entity "Group", i have an array column named "roles". this is "ArrayCollection" type. How to edit this field "roles" with Admin Generator like "Sonata Admin" when i want to create or edit "Group".
I try with "sonata_type_collection" type but no success.
Do you have an example or link who explain how to do this ?
PS: "roles" use "DC2Type:array" in Group table with MySQL.
WARNING EDIT: I'm not using Sonata anymore, #romain-bruckert comment might be better.
I think that you need to rely on the SonataAdmin field types :
array: display value from an array
boolean: display a green or red picture dependant on the boolean value, this type accepts an editable parameter to edit the
value from within the list or the show actions
date: display a formatted date. Accepts an optional format parameter
datetime: display a formatted date and time. Accepts an optional format parameter
text: display a text
trans: translate the value with a provided catalogue option
string: display a text
decimal: display a number
currency: display a number with a provided currency option
percent: display a percentage
choice: uses the given value as index for the choices array and displays (and optionally translates) the matching value
url: display a link
So for your ArrayCollection, an array type might be good.
I have five multigroup fields each one are displayed by a conditional field with a 1 to 5 value. If I select for example 2 there's a select list field appearing with is selected data , if i select 1 there's another one with an another select data.
How do I display with wiews only the content of the choosen value of the conditional field.
Thank you.
The simplest way of doing this, would be to create the logic in your theme. There are many ways of doing this, one would be to add all of the possible fields, but exclude them from display, and only show the conditional field. In one of the preprocess functions for the view, you could check the raw data for the conditional field, and replace either the field, or just the the themed value, with the value of the field you want to display.