我有一个连续8个项目,我的客户要求我从内容类型上获得实地格式,以回应一个移动设备复印机。 我创建了一个新的单元,并试图获取格式环境数据。 但却没有成功。 我只是找到一个领域,但并不是在内容类型上展示实地环境。
On picture below, I want get all data of format column, and show it as a json. Please help me. Thanks so much!
如果你想为某个具体领域提取格式环境,你可以采用这一选择:
/** @var DrupalCoreEntityEntityDisplayRepository $entityDisplayRepository */
$entityDisplayRepository = Drupal::service( entity_display.repository );
$productViewDisplay = $entityDisplayRepository->getViewDisplay( node , page , teaser /* optional */);
$all_formatters_settings = $productViewDisplay->get( content );
$formatter_settings = $all_formatters_settings[ field_my_field ];
如果你需要找到植被,你也可以在储存库中以“条码”代替“条码”代替“条码”。
/** @var DrupalCoreEntityEntityDisplayRepository $entityDisplayRepository */
$entityDisplayRepository = Drupal::service( entity_display.repository );
$productViewDisplay = $entityDisplayRepository->getFormDisplay( node , page , teaser /* optional */);
$all_formatters_settings = $productViewDisplay->get( content );
$formatter_settings = $all_formatters_settings[ field_my_field ];
There is another way to get the formatter settings.
$formatter_settings = Drupal::entityTypeManager()
->getStorage( entity_view_display )
->load("entity_type_id.entity_bundle.view_mode")
->getRenderer( field_logo_kataloga )
->getSettings();
I believe there is no human way to change any attribute or field inside an Attribute apart from doing it in the constructor. That is, short of redesigning and recompiling Visual Studio yourself. There ...
I have a base class, say BassClass, with some fields, which I made them protected, and some pure virtual functions. Then the derived class, say DerivedClass, like class DerivedClass : public BassClass....
I have a SharePoint list of Issues and have set a column (called Alert) to a “Person or Group” (allowing multiple names). I would like the system to send an email to all the users listed in the ...
I want to call a function, with as parameters a string and an Int32. The string is just a literal, the Int32 should be a field. So I thought it should be something like: .method public hidebysig ...
I access the progress DB using ODBC in my C# program, and I need to update some fields,which are array data type. so how can I write my sql statement to do such things? I read some progress ...
Basically, I need to use the User s password hash to encrypt some data via a custom model field. Check out the snippet I used here: Django Encryption. I tried this: class MyClass(models.Model): ...
I am creating a DataForm from dynamic data (so I can t create the columns in the xaml), I currently create columns for my DataGrid (I have not worked out how I can create a button + event in a colomn ...
I m using an API that has an abstract class that I wish to extend (in my concrete class) in order to take advantage of some methods within the parent. Unfortunately, the programmer of that API class ...