You are here

drupal

Drupal 8: Trusted Hosts in settings.php

I found Drupal's instructions for setting trusted hosts to be obtuse, confusing and nearly incomprehensible. After trial and error I have found the syntax that works. Following is the code -- and, most importantly, the location in settings.php near the top of the file to place the code -- for trusted host settings. Replace "example" with your domain name. (Remember, to edit settings you need to change permissions. Always re-set permissions to 0404 when finished editing.)

Views: getting a single image to display vice multiple images

Let's say you want to create an image gallery that will pull in to the gallery a single image from various content types. Some of these other content types include a single image, while others include multiple images. Using views: Under fields, add an image field; you will see that one of the configuration options is "Multiple Field Settings". Under that make sure you check the box for "Display all values in the same row". The last line under this will ask how many items you want to display. Type "1". You can also specify which number to start with if you like.

Tags:

Drupal 8: create a "files" directory in root

I've always found cumbersome and inefficient the default file system for drupal:

http://domainname1.com/sites/domainname1.com/files

Drupal is flexible of course and you can put your files anywhere you like. I prefer to have my files in root, like this:

files/d1

For this particular configuration you need to do the following.

1. Create a "files" directory in root (so that "files" sits alongside scripts, modules, sites, core, etc.)

Drupal 8: file setup for multisites, single codebase

I was unable to find a coherent explanation for running multiple Drupal 8 websites from a single codebase in a UNIX environment. Here are some notes I hope will be helpful.

1. Navigate to the “sites” folder in your root directory. Change the name of the file "examples.sites.php" to "sites.php". Edit sites.php to list your individual domain names as shown in the example below. You can have an unlimited number of domains drawing on the resources of a single codebase. Make sure to remove the * before each line.

Subscribe to RSS - drupal