Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there a setting to make a domain unlisted? That is, to make a particular domain not show up in any domain selector for visitors? This is different from making a domain inactive, because I still want the domain to function normally, I just don't want it to appear in links to the public (Domain list navigator / Domain switcher).
I imagine I'll need to remove the particular domain from the list via hooks, but I wanted to see if this was available the UI.
Comments
Comment #1
agentrickardUse hook_domain_nav_options_alter(). It's not available in the UI.
Comment #2
davidneedhamForgive my ignorance, but this doesn't seem to work how I'd expect. Does it matter that I'm trying to hide the default domain?
I'd like to remove the site at $options[1]. I've tried unset($options[1] as well as each of the following incremental changes, but it still shows up both in the "Domain list navigator" and "Domain switcher" blocks.
I also have a dsm in there to confirm the function is working and the changes are happening.
The scenario is that there is an landing page, but we don't want to access the landing page from the lists once you're on a particular subpage.
Thanks!