Latest posts

Browse topics

How To Add CAPTCHA Protection to Drupal 8 Webform

Recently I launched a new Drupal 8 website and was surprised by a spam amount we got via website's contact form (built with Webform module). 

As the website was new, I was manually blocking each spammers IP, but the amount got larger and larger, to avoid that, I decided to install Captcha module, just like in the case with Drupal 7, see: Adding CAPTCHA to Drupal 7 Webform

A CAPTCHA is a challenge-response test most often placed within web forms to determine whether the user is human. The purpose of CAPTCHA is to block form submissions by spambots, which are automated scripts that post spam content everywhere they can. The CAPTCHA module provides this feature to virtually any user-facing web form on a Drupal site.

I will assume, you have already configured your webform, now let's add captcha to it, and keep those spammers away 

Go to admin/config/people/captcha click on the tab Form settings, as we are using Webform module here, enable node_webform_form 

Drupal 8 configuring captcha module

Drupal 8 configuring captcha module

Once, enabled, click edit and in the blank text box under "Form ID" enter the form_id (not the node id) of the webform and save the configuration. 

To quickly find the form_id of the webform, take the node id and insert it to "webform_submission_contact_node_XXX_add_form", for example, if the node id is 6 your webform form_id will be "webform_submission_contact_node_6_add_form". You can also use firebug to inspect the form_id field.

Go to the webform page (as an Anonymous user) and you should be able to see the captcha there.

Captcha enabled on Drupal 8 webform

Captcha enabled on Drupal 8 webform

Another quite effective way to fight webspam is by using the AntiBot module, see my article here: Fighting Webform Spam - Drupal 9 - AntiBot


If you're in need of someone with expertise in Drupal development and module configuration, I might be just the person you're looking for. As the founder of Terramatris.eu, a Drupal development agency, I have years of experience working with this platform and helping clients achieve their goals through custom Drupal installations. Learn more at Terramatris.eu

Restaurant Imeruli Ezo

Restaurant Imeruli Ezo is a nice roadside restaurant located in Natakhtari (this area is famous for its restaurants)

We made a lovely dinner here at the start of June 2020, returning from our adventures at the Poppy fields near Mchadijvari

Inside yard at Imeruli Ezo

Inside yard at Imeruli Ezo

In direct translation from Georgian to English - Imeruli Ezo - means - Imeretian yard. And yes they are serving here Imeretian style food.

Food at Imeruli Ezo

The food at Imeruli Ezo

We ordered some salads, mcvadi, badrijani, Turkish Coffee, and some Georgian lemonades. 

How To Create a Custom Drupal 8 Theme based on Bootstrap

When building a new Drupal website I prefer working with a Bootstrap theme and apply a subtheme 

Just like in the case with Drupal 7, theming a subtheme based on Bootstrap is super simple - in a few words - download and enable a Drupal 8 bootstrap theme, then in the Drupal themes folder create a new theme folder and make a custom info.yml file

here is a live example from OptionsBrew.com theme

  • in the themes folder, create a new folder -> optionbrew
  • in the optionbrew folder create a new file - > optionsbrew.info.yml

in the optionsbrew.info.yml file paste following:

core: 8.x
type: theme
base theme: bootstrap

name: 'OptionsBrew'
description: 'A custom Drupal Bootstrap 3 based sub-theme for OptionsBrew.com.'
package: 'Bootstrap'

regions:
  navigation: 'Navigation'
  navigation_collapsible: 'Navigation (Collapsible)'
  header: 'Top Bar'
  highlighted: 'Highlighted'
  help: 'Help'
  content: 'Content'
  sidebar_first: 'Primary'
  sidebar_second: 'Secondary'
  footer: 'Footer'
  page_top: 'Page top'
  page_bottom: 'Page bottom'

Save the file and clear the cache for the Drupal website. Now when accessing admin - > appearance, you should see your custom Drupal 8 theme 

Custom Drupal 8 theme

Custom Drupal 8 theme

Now Install and set as default

here you go, we just created and enabled a custom Drupal theme based on Bootstrap 3, now it's up to you how you will theme it

When using Bootstrap subtheme I usually do very little rewriting, mostly with some custom css stylying

How To apply Custom css and js to Drupal theme

Here is a good read on apply css and js for Drupal 8: Adding stylesheets (CSS) and JavaScript (JS) to a Drupal theme

Defining a library

Define all of your asset libraries in a *.libraries.yml file in your theme folder. If your theme is named optionsbrew, the file name should be optionsbrew.libraries.yml. Each "library" in the file is an entry detailing CSS and JS files (assets), like this:

global-styling:
  version: 1.x
  css:
    theme:
      css/layout.css: {}
      css/style.css: {}
      css/colors.css: {}
global-scripts:
  version: 1.x
  js: 
    js/navmenu.js: {}   

To be available everywhere in the theme, the global-styling/global-scripts libraries must then be added to your theme's info.yml (in this case optionsbrew.info.yml)

libraries:
  - optionsbrew/global-styling

Hope it helps!

Happy Kids Saldus

Happy Kids Saldus is a cool kid's amusement park in the town of Saldus, Latvia.

I first read about in on a local Latvian Daily Business newspaper, and soon as I had the chance took our baby girl to play here.

Amusement park "Happy Kids" at the Saldus bypass road has created a place to celebrate children's parties and other holidays.

Happy Kids indoor ammusement park in Saldus

Happy Kids indoor amusement park in Saldus

We visited this park on March 2020, back then the entrance fee was like EUR3/h per kid or EUR 5 for 2 hours. 

Popular party place for kids parties in the area

Popular party place for kids parties in the area

Playground for the little ones (toddlers)

Playground for the little ones (toddlers)

June 2020 Dividend Income Report - $82.11

Welcome to the thirty-eight (#38) dividend income report, covering earnings I've made from dividend-paying stocks and peer to peer lending in June 2020.

Just like the previous months, the last June we also spent in a self-isolation (because of Covid-19) here in Georgia. More of the strict lockdown measurements were lifted (inner tourism, restaurants and hotels were opened for public)  we did a few weekend trips with an overnight stay at local resorts here in Georgia.  Baby girl is started to attend her pre-school, she is doing great - talking a lot, putting together sentences, mixing languages, figuring out new words. Awesome. Quite fascinating what a 23-month-old can do. Development is very rapid.

Lopota Lake resort in Georgia

Lopota Lake resort in Georgia

From the perspective of dividend income -  last June was very bad, we barely took $82.11, most of our dividends are trimmed or halted for now. There is a light at the end of the tunnel, but relying on dividends these days is very hard.

Compared to the previous June in 2019, when we almost took $300 in dividend income, our monthly dividend has decreased by -72.59%  (-$217.49). A year ago we did set a goal to take at least $400 this month, now this didn't happen. Scary. What even scarier our dividend income level last June was at the level we received back in June of 2017. 

Luckily, an additional $1,150.29 was made from options trading.   As options trading is not a passive form of making money while you are sleeping it wouldn't be fair to include them in dividend income reports. Check out our options income report here: June 2020 Options Income Report - $1,150.29

If counted all together (dividends + options) it seems we have made $1,198.40 in total last month.

We were able to generate about 6.53% income yield from our portfolio last June (that's about 78.36% annualized)

One of our monthly goals is to generate at least 2.5% income yield from the portfolio. As longs it's above to it - it's awesome.

Interest income in June 2020

From the stocks and peer to peer lending we got following income last month:

Ticker

Earnings

EDI

€13.93

USA

€12.72

Mintos

€10.58

EDF

€9.69

RA

€7.53

NCV

€6.44

PEI

€4.54

AWP

€3.63

BAC

€2.86

PFE

€2.01

Total EUR 73.97 / USD 82.11

In total there were 10 companies paying us dividend in June 2020 that is 8 companies less than in June 2019

Monthly income

I've been tracking my journey towards million dollars in a savings account since January 2017. More than three years already. The result, so far, looks quite good. Dividends are growing (even when they are not)

Monthly dividend Income chart as of June 2020

Monthly dividend Income chart as of June 2020

The cumulative earnings for 2020 now are $964.83  which is exactly 26.80% from my goal of 2020 ($3,600). On average, it would ask us to generate $439.20 every month for the next 6 months to reach this goal. Right, now the goal looks unattainable, as for now, I cannot see even a single $300 month for 2020, but this could change later, during the year as we are trying to add more quality stock to the portfolio. 

2019 in Review and Financial Goals for 2020

Goals for June 2021

This is my favorite part of the reports - trying to forecast/set goals for the next year. But before setting a goal for 2020, let's see what I forecasted/said a year ago (June 2019)

For 2020, I'm looking to take at least $400 in dividend income. 

Nah... we didn't even come close... our dividend stock portfolio wasn't immune against the market downturn and most of our stocks get trimmed or halted dividend payments. In the case of the recovery, there is hope. I will be optimistic and say we are still looking to crack that $300/mo goal in June 2021