BS Base

@TODO - this will be a documentation for bs_base base theme.

Webform 8.x-5.x: How to track a webform submission's geolocation [VIDEO]

How to track a webform submission's geolocation


I would like to track where a form is being submitted from using the web browser's geolocation.


Create a hidden location element that tracks the user's geolocation as the default value.

Webform 8.x-5.x: How to create a custom Views exposed filter form [VIDEO]

 How to create a custom Views exposed filter form


The Views module allows filters to be exposed as a form above the displayed results or even as a block. The problem is that the Views module only supports one exposed filter form per view display and the exposed filter form displays all the available exposed filters.

Webform 8.x-5.x: How to programmatically alter destination email address

You can alter the destination (to) address by adding a WebformHandler plugin. You can for example extend the EmailWebformHandler and add your own custom logic. This example changes the recipient based on the site's language:

The location of this file would be my_module/src/Plugin/WebformHandler/MyEmailWebformHandler.php

Using the default Drupal search block to get the results in Views

I am using Search API in Views with many exposed filters. My client wants a search block in the site's header that shows the results in Views. I only need one filter on the header, not all the others, so I can't use Exposed form in block. Also, when seeing the results, I need all the exposed filters to be shown in top of the results, not in the header. I didn't find a solution in internet, so I write my solution code here. If you know a better solution, please, add it in the comments.

I have created a simple module to solve the problem.



Subscribe with RSS Subscribe to RSS - Beginner