Error message

Notice: Undefined index: quantity in omega_views_mini_pager() (line 214 of /var/www/vhosts/pixelthis.gr/httpdocs/sites/all/themes/omega/omega/includes/omega.theme.inc).

Blog

This is the code for checking if a field is empty <?php if ($entity->hasField('field_myfield')  && !$entity->get('field_myfield')->isEmpty()) {  // Do something ...}?>
Installing radix with composer and creating a new subtheme via the drush terminal is kind of messy. There are various posts about different versions of radix combined with specific version of the components module and a patch that needs to be applied in order for the radix drush alias...
If you want to check with hook_form_alter if the taxonomy term is new or updated (old) you can't use the form_id or the $form_state->getFormObject()->getOperation() because it always returns "default". The solution for this is : $form_state->getFormObject()->getEntity()->...
Put this code at the end of your local development settings file (/web/sites/default/settings.local.php) <?php// Include Kint class.include_once(DRUPAL_ROOT . '/modules/contrib/devel/kint/kint/Kint.class.php');// If debugging is very slow or leads to WSOD reduce the number// of levels...
Οι αρχαίοι Έλληνες, πριν αναπτύξουν τις επιστήμες, προσπαθούσαν να δώσουν φανταστικές εξηγήσεις για τα διάφορα φυσικά φαινόμενα. Έτσι π.χ. θεωρούσαν τον κεραυνό ως ένα από τα όπλα με τα οποία ο θεός Δίας τιμωρούσε τους κακούς ανθρώπους, ενώ σήμερα ξέρουμε όλοι ότι αυτός οφείλεται στον...
On my custom theme i have a region with 2 blocks. It is an event region block. The first block is a header block and the second block is a view block that renders the active - running events. However when there are no events the view result is an empty result so nothing is rendered but...
Applying patches in drupal 8 is different compared to drupal 7. Composer does a decent job alleviating the headaches of managing several sites with different dependencies. However, out of the box Composer will revert patched core files and contrib modules and it is for that reason...
For a recent project, i was asked to build a service that would consume the client's internal data from his API. I got lucky with this because it was a very well structured and documented API. The only thing that i had not tried before was to use the new Drupal::httpClient() functionality...
You can add this to your class or Controller etc. It always return the taxonomy term id if yound <?phpuse Drupal\taxonomy\Entity\Term;  //Vid in drupal 8 is the vocabulary machine name e.g news_categories and not an integer id as in drupal 7  private function manage_term($term_name,$...
Setting the proper values at a geolocation field programmatically in drupal 8 is different from typical field values. This code will do the trick: <?phpuse \Drupal\node\Entity\Node;$node = Node::create(  'type' => 'location',  'title' => 'Attraction Location',  '...
Drupal Core Views module is very sufficient most of the time but sometimes you need to create a list of content programmatically. This is where you could use EntityQuery. Let's say you'd want a list of custom api blog items imported to your website per specific cron tasks. What you have...
Recently i had to make a GET API request with some params (form-params) to the body of the API request call. This is what worked for me: <?php  public function poi_call(int $id,$timestamp_start = '2020-01-01 00:00:00',$timestamp_end = '2020-12-01 00:00:00') {    try {      $options...
this is an arrow pointing back to the top of the page