Friday, November 30, 2018

DRUPAL 8: Block of nodes referencing the current node

we have  contentype Publication and a contenttype Article
The contentype Article references the contenttype Publication
(the referencing field is f.i.  field_editie_s )
Multiple articles reference one Publication

Article --- fied_editie_s ---> Publication

Create a block view on anny  Publication page listing all nodes referencing that page

1.  create view
Administration > Structure > Views > Add a New View
1.1 Create a block view
1.2 Filter on the child element: Article

1.3 add relationship

choose: 'content referenced from field_editie_s'
click: 'add and configure'
select 'require this relationship'

1.4 add contextual filter

under relationship choose: field_editie_s: content
choose ID (content)
click 'add and configure contextual filter
select 'provide default value'
select 'Content ID from URL'
click save

test it by inserting a node is from a publication node in the preview with contectual filters

now show the block on the publicatiosn pages

Tuesday, September 4, 2018

Drupal 8 And Spam....

The most annoying thing on this web is those people running around and sending you long russian texts about dehydrators or viagra or whatever.... The web is like a city where half the population consists of naked or partly naked whores, the other half are salesman trying to sell you stuff you don't need or did not even know it existed and the last 1 percent or so is real information.

Some of my sites keep being attacked by spambots posting this nonsense. I leaned heavily on the Aquia service Mollom, which was a great module, but that service unexplainably stopped in april 2018.

So, what to use on Drupal 8 sites to stop this useless salesy bantering and pointless digital screaming on our sites:

The first module you can deploy is captcha. This is the simple Stop and frisk module to see if you are human.
ImageCaptcha, is the Stop and frisk and ask some more questions version of the above. You have to interpret an image before you can send in a form. (I always find this one very annoying.)

This is the user friendly update of the above two modules, it simply asks you to check a box  titled: I am not a robot.
As long as the artificial intelligence is on the current level this module will suffice.

This is a module that requires no user interaction at all, so it is my first choice to use. Depending on the user interaction times it decides whether you are a human or a bot. Furthermore it does a hide and seek action with fields that the bot thinks it needs to answer but the humans do not see. This module worked great, but of course the bot priogrammers are not stupid so they are finding ways to fool this one......

Antibot uses some of the same techniques as honeypot, user interaction time and hidden fields, but seems to when honeypot... And the other way around. It is purely based on javascript/css, but prohibits users without javascript to send forms. (So you have to make an extra form for users without javascript with one of the above modules connected and another mailadres attached on which you will receive the old amount of spam)

This one is not yet available for Drupal 8, but it seems to provide the same functionality as Mollom did.

Human Presence
This one is rather affordable for drupal: 5 euros per month and seems to provide the same functionality as Mollom did, but also seems to use more advanced technologies... (Or they know how to present their products in a sexy way). I did not try this one out yet, and update here as soon as I did...