Server side lookup field filtering

I am developing my own lookup field.

I want it to have dynamically filtered values collection depends on user which makes new item.

What method of lookupfield class I should override to make my own collection of values to send on client to render there?

I need send from server to client side additional info about items in related lookup list as well.

And all this I really need to do on server side.

Multiple solutions all about client side… REST CSOM JSLINK CSR..

Any advice please about server.

How to get entity field value with the Node content?

I have two content types Artist and Artist Type, And in the artist content type, I have created the entity field for artist Type. I have created the 4 nodes for the artist type artist type 1,artist type 2, artist type 3,artist type 4.During the creation of artist node I have selected the one from all artist type. Also, I have created the Artist type of view and shown the information according to the contextual filter: ID. But not getting an idea of how to get the value of all node title value of artist content type in the artist type node preview page?

How to use hook_views to add calculation to a field?

In a custom module (assoc), I have a custom Content Entity (Person) with these fields:

$  fields['lastname'] = BaseFieldDefinition::create('string') $  fields['firstname'] = BaseFieldDefinition::create('string') $  fields['email'] = BaseFieldDefinition::create('email') $  fields['cellphone'] = BaseFieldDefinition::create('telephone') $  fields['balance'] = BaseFieldDefinition::create('integer') 

I use Views to display a table of the persons. Here is the corresponding Views preview: enter image description here Before displaying the output, I’d like to add some value to the field ‘balance’:
balance = balance (of content entity) + somecredit - somedebit
‘somecredit’ and ‘somedebit’ being calculated by a query to the database.
What is the hook_views I should use ?
And how do I do?

Replacement pattern for one value of a multivalue field in views

Rewriting the results of a views field, I wonder if there is a way to use a replacement pattern for the first, second and third value of a multivalue field.

In my case, as example:

I have tried to use this rewritten tags field: [field_tagging:0] [field_tagging:1] [field_tagging:2]

However, this is not rewritten/recognized as replacement patterns.

The result I need, is that in the views field has three tag links, which have a rewritten path (in this case it also uses !1 for the contextual value in the URL)

Strip HTML tags from Field Collections in Services Views

I’m trying to strip the HTML tags from a JSON response I generated using Services Views, but I’m not having any luck so far. I have a content type with a Field Collections field in it that is outputting HTML tags no matter what I do. I’ve tried the following:

  • Check Strip HTML tags in the field settings in the view
  • Set customize field HTML to ‘None’
  • Set Customize field and label wrapper HTML to ‘None’
  • All combinations of the above
  • Making sure to turn of all ‘Provide default field wrapper elements’ options

Am I missing anything? My output still looks like this in my json:

"Animals": [             "<div class=\"entity entity-field-collection-item field-collection-item-field-product-animals clearfix\">\n  <div class=\"content\">\n    <div class=\"field field-name-field-product-animal field-type-taxonomy-term-reference field-label-above\"><div class=\"field-label\">Animal:&nbsp;</div><div class=\"field-items\"><div class=\"field-item even\">Big</div></div></div><div class=\"field field-name-field-product-withdrawal-time field-type-text field-label-above\"><div class=\"field-label\">Withdrawal time:&nbsp;</div><div class=\"field-items\"><div class=\"field-item even\">25 dg</div></div></div>  </div>\n</div>\n",             "<div class=\"entity entity-field-collection-item field-collection-item-field-product-animals clearfix\">\n  <div class=\"content\">\n    <div class=\"field field-name-field-product-animal field-type-taxonomy-term-reference field-label-above\"><div class=\"field-label\">Animal:&nbsp;</div><div class=\"field-items\"><div class=\"field-item even\">Rund vlees</div></div></div><div class=\"field field-name-field-product-withdrawal-time field-type-text field-label-above\"><div class=\"field-label\">Withdrawal time:&nbsp;</div><div class=\"field-items\"><div class=\"field-item even\">21 dg</div></div></div>  </div>\n</div>\n",             "<div class=\"entity entity-field-collection-item field-collection-item-field-product-animals clearfix\">\n  <div class=\"content\">\n    <div class=\"field field-name-field-product-animal field-type-taxonomy-term-reference field-label-above\"><div class=\"field-label\">Animal:&nbsp;</div><div class=\"field-items\"><div class=\"field-item even\">Pluimvee ei</div></div></div><div class=\"field field-name-field-product-withdrawal-time field-type-text field-label-above\"><div class=\"field-label\">Withdrawal time:&nbsp;</div><div class=\"field-items\"><div class=\"field-item even\">6 dg</div></div></div>  </div>\n</div>\n" 

Any help on this is greatly appreciated.

How do I create a custom view filter for an existing field?

I ran into a problem with creating a custom view filter for an existing field for Drupal 8. I mean a filter not for fields like “nid”, “title” and so on, but for fields, which were named CCK-fields first.

Could you share with me an understandable example of code, how to create this plugin?

I tried to comprehend some examples in contrib modules, like the geolocation module, but that code was very sophisticated. Also, I haven’t found adequate manuals anywhere.

Views Custom Field Handlers tokens

I am using simple views custom field handler. And I would like to make list of custom tokens for this $ data array I have. How could I do that?

class custom_views_handler_field_hostname extends views_handler_field {    function render($  value) {       $  location = get_some_data_from_outside;       foreach ($  location as $  key => $  value) {       $  data [] =  $  key. ': ' . $  value;     }      if (!is_array($  value)) {       return theme('item_list',           array(             'items' => $  data,             'title' => NULL,             'type' => 'ul'           ));     }   } 

Magento 2 checkout knockout.js in custom template error – telephone field

I’m trying to create a mask for telephone field in Magento 2.2.2 checkout. In order to do so. I placed a checkout_index_index.xml with a new template for telephone field at

vendor/mytheme/Magento_Checkout/layout/checkout_index_index.xml

    <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">     <body>         <referenceBlock name="checkout.root">             <arguments>                 <argument name="jsLayout" xsi:type="array">                     <item name="components" xsi:type="array">                         <item name="checkout" xsi:type="array">                             <item name="children" xsi:type="array">                                 <item name="steps" xsi:type="array">                                     <item name="children" xsi:type="array">                                         <item name="shipping-step" xsi:type="array">                                             <item name="children" xsi:type="array">                                                 <item name="shippingAddress" xsi:type="array">                                                     <item name="children" xsi:type="array">                                                         <!-- The name of the form the field belongs to -->                                                         <item name="shipping-address-fieldset" xsi:type="array">                                                             <item name="children" xsi:type="array">                                                                 <!-- the field you are customizing -->                                                                 <item name="telephone" xsi:type="array">                                                                     <item name="component" xsi:type="string">Magento_Checkout/js/view/masked</item>                                                                     <item name="config" xsi:type="array">                                                                         <!-- Assigning a new template -->                                                                          <item name="elementTmpl" xsi:type="string">Magento_Checkout/form/element/telefone</item>                                                                      </item>                                                                 </item>                                                             </item>                                                         </item>                                                     </item>                                                 </item>                                             </item>                                         </item>                                     </item>                                 </item>                             </item>                         </item>                     </item>                 </argument>             </arguments>         </referenceBlock>     </body> </page> 

In the folder vendor/mytheme/web/js/view/masked.js I place bellow code

define(['jquery', 'uiComponent', 'ko', ], function ( $  , Component, ko) {         'use strict';          return Component.extend({              defaults: {                 template: 'Magento_Checkout/telefone'             },             initialize: function () {                 var self = this;                 this._super();                 ko.bindingHandlers.maskedInput = {                     init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {                     ko.bindingHandlers.value.init(element, valueAccessor, allBindings, viewModel, bindingContext);                     },                     update: function(element, valueAccessor, allBindings, viewModel, bindingContext) {                         ko.bindingHandlers.value.update(element, valueAccessor, allBindings, viewModel, bindingContext);                         $  (element).mask(allBindings.get('mask'));                         valueAccessor()($  (element).val());                     }                 };                  var ViewModel = function() {                      this.phone = ko.observable("");                       this.phone('123123451212');                 };                  ko.applyBindings(new ViewModel());         }      }        ) } ); 

And the I created template telefone.html at vendor/mytheme/Magento_Checkout/web/template

<input class="input-text" type="text" data-bind="     value: value,     valueUpdate: 'keyup',     maskedInput: phone,      mask: '(999) 999-9999',     hasFocus: focused,     attr: {         name: inputName,         placeholder: placeholder,         'aria-describedby': noticeId,         id: uid,         disabled: disabled     }" /> 

But when I go to checkout I get error: Uncaught Error: You cannot apply bindings multiple times to the same element. Does someone know a proper way to apply phone mask to telephone input at checkout. Or, if my method is correct, what am I missing or doing wrong?

Semicolon delimited text field used in email workflow

unfortunately, I still have some forms on SharePoint 2007. Somehow, a workflow that was created by a previous person disappeared (grew legs and walked away? idk). I am looking to recreate this workflow but cant wrap my head around getting it done, here’s the scoop:

I have a form that allows for selection of multiple checkboxes. These checkbox selections are then concatenated (this step isn’t required if you dont think its needed, I just couldnt find a way to reference the selected checkboxes directly) into a text field like so:

XXXXX; YYYY; Selection3; Selection4; Selection5; etc.

I need my SharePoint workflow to look up each of these values (from another list) and find the corresponding emails to each of the values and then place those values (semicolon delimited) into the To: box to send the email.

So basically, it has to take Selection1 and reference the email list to find Selection1‘s corresponding email and place it into the To: box (and do that for every selection/concat them).

Thanks in advance for any help.