1

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.

  • Are you referring to field plugin? If yes, check webomelette.com/creating-custom-views-field-drupal-8 – Ismail Cherri Sep 12 '18 at 0:28
  • Unfortunately, that example is not for CCK-fields. What do I want? For example, after installing Drupal there is a node type "article", which contains a field "tags". Foer example, I have got a great idea and I want to create awesome views filter by this field. – Yakimkin Roman Sep 12 '18 at 5:24
  • This article demonstrates how to create a filter on existing field. lilengine.co/articles/… – simesy Jun 16 at 13:33
0

If you do not need to code your Views filter, in your Articles View, you have a Filter criteria section where you may add views filters based on many different entities, including fields (what you call CCK fields). enter image description here enter image description here

  • 1
    I mean how to create my new filter plugin programmatically, not via admin-interface. I haven't found any understandable code for it. – Yakimkin Roman Sep 12 '18 at 9:45
  • OK, my mistake then, my answer is useless to you. – Toki Sep 12 '18 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.