How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

My employer has a social intranet site with 1000s of users, groups, communities and blogs. Users are free to ‘follow’ or ‘like’ nodes, blogs and other users, subscribe to communities, join groups etc. What I’m trying to achieve is the... read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

Display field collection items by using twig

I’m using the field collection module in Drupal 8 to encapsulate event informations so I’ve got a field collection with six sub fields (place, starting time, etc.). In my twig template field–field-event.html.twig, I’d like to extract each item... read more
How to add multiple products to cart at the same time with attributes

How to add multiple products to cart at the same time with attributes

I have different view blocks that display multiple products on the same page, each product has their own attributes such as product bundle and custom line item, these serves as an option set / criteria of the main product. The results of the options slider will be the... read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

How do I correctly setup caching for my custom block showing content depending on the current node?

I have this very basic block which just shows the current node’s ID. <?php /** * @file * Contains DrupalmymodulePluginBlockExampleEmptyBlock. */ namespace DrupalmymodulePluginBlock; use DrupalCoreBlockBlockBase; use DrupalCoreCacheCache; /** * @Block( * id =... read more
Add flag counter in views Module(Search API index)

Add flag counter in views Module(Search API index)

I want to add flag counter of content in views field. Authenticated users can flag(bookmark) contents. I want to know how many users flaged a content, And I want to add this in views field(display the number of times a node is flagged by a certain flag by Users).... read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

How do I get the Unix timestamp?

I want to use format_date(), but it requires a Unix timestamp and my dates are ISO. Is there a drupal way to convert ISO date to Unix timestamp? If I use strtotime, I lose my timezone offset. read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

How can we apply group_concat using views?

Is there any way we can apply group_concat clause using views and without applying any customization to views ? read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

How to add jQuery Datepicker option which accepts a function as an argument

I have added a date_popup field to a form : $form[‘arrival_date’] = [ ‘#type’ => ‘date_popup’, ‘#title’ => t(‘Arrival date’), ‘#date_format’ => ‘d/m/Y’,... read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

How can I use ‘xx time ago’ as date format?

How can I use ‘xx time ago’ for date format in Drupal 8 nodes ? I want to replace “xx time ago” with {{ date }} in node. In Drupal 7 it worked with this code : <?php print format_interval(time()-$node->created); ?> read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

How to get the valid URL of a Link field from within a Twig template?

I have a Link field named field_my_link (machine name). Within a Twig template I can get the link’s URL value with this: {{ node.field_my_link.uri }} If inside the Link’s URL there is an external URL, e.g. http://example.com it works good. But, if inside... read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

"Uncaught TypeError: Cannot read property ‘getAttribute’ of undefined"

There are some posts about this error for Drupal 7, but I’m using Drupal 8.1 and those solutions don’t work for D8. I tried this patch (coded for D7) and doesn’t work. The effect of the error is that QuickEdit doesn’t work: sometimes the quick... read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

"Non-existent service" errors after clearing the cache

After clearing the cache in Drupal 8 (via the UI) I got “The website encountered an unexpected error. Please try again later.” error. It happened for the first time. I haven’t introduced any heavy changes to the site, basically only created a field... read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

How to add a class to the <a> link elements within a Multiple Values field in a View?

I have a Views field (in this case, taxonomy term references) with Multiple Values set to “Display all values in the same row”, using the Link formatter and a seperator. I want to add a class to each “multiple values” <a> element within... read more
How can I embed a View inside a content of a node?

How can I embed a View inside a content of a node?

How can I embed a view inside a content of a node in Drupal 8? I found something similar, for example in the question about “How do I embed a view inside a node?” or the Viewfield module, but it is all for Drupal 7. I tried with an Entity reference field... read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

How to display entity label using entity reference field checkbox form display

I am working with Drupal 8. And I want to create a field of entity_reference type. The field has a reference to context_question entity. And the field is displayed fine, but without any description beside the check boxes. The context_question entity has a label field... read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

How to get Address Field to display correctly with Autocomplete?

I want to create a postal field for addresses in the Philippines. I have set up a sandbox site with a content type that has just one field, of type addressfield and using the autocomplete widget. Only one country is allowed. However, when I create content, all I can... read more
Insert multiple checkbox value from webform into table

Insert multiple checkbox value from webform into table

I created: a webform named Test Number checkboxes checkboxes named Number with values one, two and three using Form Builder a table named checkbox_check Aim: When the webform is submitted, the values selected are placed in a string and saved into the table. Example:... read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

How do I fix a "Mismatched entity and/or field definitions" error on my configuration?

I’m getting the following error on my Drupal 8 configuration page. Entity/field definitions Mismatched entity and/or field definitions The following changes were detected in the entity type and field definitions. Content Update the node.rng_capacity field.... read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

Avoid user to multiple purchase of same product

I would like avoid a user to buy the same product twice or more, I’m not speaking about the quantity limitation during the checkout (I’ve already set quantity to 1 for every purchase)…for example..after a user has bought a product(He has completed... read more
How to implement Instant Notifications to ‘follow’ or ‘like’ nodes?

how to add checkbox value as json data

I have created a custom module for a form. And I have json data which I want to add as checkbox values. $request = drupal_http_request($url); $jsonarray =drupal_json_decode($request->data); print_r($jsonarray); foreach($jsonarray as $info) { $output1 =$info[0];... read more