4 votes

Cookie sharing on multidomain site

This is not really a Drupal question, but a browser question. The cookies a browser has for example.com will never be sent to example.org. You can look at other ways to create federated login, but ...
greggles's user avatar
  • 5,242
3 votes

How to restrict access to specific php file to only athenticated users

.htaccess won't help with this; Apache doesn't know what an authenticated Drupal user is, and there's no easy way to grant it that knowledge. Fortunately there's a much better option: Create a route ...
Clive's user avatar
  • 167k
3 votes

What is the equivalent of domain_get_domain()?

Finally worked out the following ... $domainNegotiator = \Drupal::service('domain.negotiator'); $current = $domainNegotiator->negotiateActiveHostname(); There are other methods on the ...
Delford Chaffin's user avatar
3 votes

How to pass dynamic parameters through a local action button?

Local actions and local tasks are quite similar, so looking at the Customising local task behavior I've managed to pass in dynamic route parameters to my local actions by specifying the class ...
user92937's user avatar
2 votes

Too many redirects error with https and domain access module

Just in case anyone stumbles upon this (or perhaps for my future self). The issue ultimately ended up being Cloudflare. If you use Cloudflare for any of your domains don't forget to include it in the ...
Tom's user avatar
  • 21
2 votes

Share nodes and users across multiple sites

Sharing users can be done by setting up OpenAuth or something like it. Sharing nodes can be done using views database connector this tool will let you pull data from a table in another database. To ...
Daniel Lefebvre's user avatar
2 votes

How to pass values to content creation page to set default values in form elements?

Altering the form You should implement the hook_form_FORM_ID_alter. Then, read the parameters like this: $name = \Drupal::request()->request->get('country'); // from param Then alter the form ...
Cesar Moore's user avatar
  • 1,538
2 votes

Can I still share data tables with multisite, using shared database, in Drupal 8 or do I need to use 'Domains' contrib module?

posting my own answer with a brief explanation... I have investigated the Config Split and Features modules and found that they are not providing what we need for this instance of Drupal running a ...
rwcorbett's user avatar
  • 203
1 vote

How to load all aliases of a domain

Got it. The 'hostname' is not a property of the alias. The way to get the aliases is: $aliases = \Drupal::entityTypeManager()->getStorage('domain_alias')->loadByProperties(['domain_id' => '...
GoingDrupal's user avatar
1 vote

Language detection by domain breaks ajax requests over https

The problem is the CDN, which connects to Drupal via HTTP and to the client via HTTPS. Then all absolute URLs generated by Drupal have the wrong protocol. Not only this one for ajax, which is absolute ...
4uk4's user avatar
  • 99.6k
1 vote

How to pass dynamic parameters through a local action button?

Since it's a cache issue, awaiting an official fix, I solved it by rebuilding actions on the page in question: function my_module_preprocess_page(&$variables) { if (\Drupal::routeMatch()->...
Kwadz's user avatar
  • 489
1 vote

What is the equivalent of domain_get_domain()?

In drupal 8 there is \Drupal::request() to get request info. For Example if your url something like https://example.com If you want only the domain name example.com $domain = \Drupal::request()->...
berramou's user avatar
  • 7,185
1 vote

Test domain access module

You can easily craft a test that uses CURL to hit your site using domainA and another curl request to hit your site using domainB. What I would do is make sure each theme contains its own favicon (...
bleen's user avatar
  • 1,500
1 vote

Filter node indexes by current domain

For showing nodes of particular domain on a particular domain, you dont need avaliable on current domain. First you have to see, if you are able to see the list of nodes on a particular node without ...
Manoj Bisht's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible