This template builds Drupal 11 using the Drupal Composer project for better flexibility. It also includes configuration to use Redis for caching, although that must be enabled post-install in .platform.app.yaml.
Drupal is a flexible and extensible PHP-based CMS framework.
- PHP 8.3
- MariaDB 10.11
- Redis 7
-
Run through the Drupal installer as normal. You will not be asked for database credentials as those are already provided.
-
Once Drupal is fully installed, edit your
.platform.app.yamlfile and uncomment the line under therelationshipsblock that readsredis: 'rediscache:redis'. Commit and push the changes. That will enable Drupal's Redis cache integration. (The Redis cache integration cannot be active during the installer.) -
Review the docs for more information: platform.sh docs for Redis with Drupal
The following changes have been made relative to Drupal 11 as it is downloaded from Drupal.org. If using this project as a reference for your own existing project, replicate the changes below to your project.
- It uses the Drupal Composer project, which allow the site to be managed entirely with Composer. That also causes the
vendorandconfigdirectories to be placed outside of the web root for added security. See the Drupal documentation for tips on how best to leverage Composer with Drupal. - The
.platform.app.yaml,.platform/services.yaml, and.platform/routes.yamlfiles have been added. These provide Platform.sh-specific configuration and are present in all projects on Platform.sh. You may customize them as you see fit. - The
.platform.template.yamlfile contains information needed by Platform.sh's project setup process for templates. It may be safely ignored or removed. - An additional Composer library,
platformsh/config-reader, has been added. It provides convenience wrappers for accessing the Platform.sh environment variables. - The
settings.platformsh.phpfile contains Platform.sh-specific code to map environment variables into Drupal configuration. You can add to it as needed. See the documentation for more examples of common snippets to include here. It uses the Config Reader library. - The
settings.phpfile has been heavily customized to only define those values needed for both Platform.sh and local development. It calls out tosettings.platformsh.phpif available. You can add additional values as documented indefault.settings.phpas desired. It is also setup such that when you install Drupal on Platform.sh the installer will not ask for database credentials as they will already be defined.
Run:
composer install (or composer update to get latest versions)
ddev start
ddev quickstart (Install Drupal using the Standard installation profile and recipes) Note that this should ONLY be run on a new site.
Log in using the password reset link in the console and reset the admin password
You can run node commands in the active default theme with the command:
ddev theme install (equivalent to npm install)
ddev theme run css (equivalent to npm run css)
ddev theme run js (equivalent to npm run js)
You can run core/scripts/drupal commands (ie. recipes, generate-theme) with the command:
ddev drupal recipe ../recipes/ws-recipes (equivalent to php core/scripts/drupal recipe ../recipes/ws-recipes)
ddev drupal generate-theme "mynewtheme" --starterkit kraken --path themes/custom (equivalent to php core/scripts/drupal generate-theme "mynewtheme" --starterkit kraken --path themes/custom )
Once your build is done and modules installed, enable redis caching. You CANNOT have this enabled when first installing the site.
# redis: 'rediscache:redis'
Commit your change and let build. Redis should be operating with the default settings. To verify, refer the platform.sh documentation
There is rudimentary integration for local testing in cypress at the moment. To being using it:
- update the
baseUrlin thecypress.jsonfile to match your local domain (ie.https://mysite.ubc.ca/). - update the
package.jsonwith a the name and links to your repo - install it with
npm install - start it up with
npm run cypress:open
You can find the sample tests and add new ones in the cypress/integration directory.
See the cypress docs for more information.
To fully integrate with github actions and platform workflows, see this repo
- Administrator: all permissions
- Editor: Access to
- All content types
- Media
- Non-admin taxonomies
- Menus
- Blocks
- Google Analytics
- Redirects
- URL aliases
- Metatags
- User creation and role assignment
- Content Creator: Access to
- Add / edit Announcement, Event Page, Profile
- Media
- Announcement
- Default
- Card: Horizontal
- Card: Image
- Card: Vertical
- Featured Content
- Teaser
- Event
- Default
- Card: Horizontal
- Card: Image
- Card: Vertical
- Featured Content
- Teaser
- Homepage
- Default
- Custom Content
- Featured Content
- Teaser
- Landing Page
- Default
- Card: Horizontal
- Card: Image
- Card: Vertical
- Custom Content
- Featured Content
- Teaser
- Page
- Default
- Profile
- Default
- Card: Horizontal
- Card: Vertical
- Teaser
- File
- Image
- Private file
- Remote video
- SVG Icon
- Video
- Code Block
- Quicklinks Block
- Card
- Card Group
- Featurette
- Icon Card
- Image Card
- Slide
- Slideshow
- Tab
- Tabcordion
- Text
- suggestions for additional types: Hero image, Image Gallery
-
Content: Announcement Feature (Featured Content view mode on announcement node)
-
Content: Announcement List (List of announcement cards with exposed filters)
-
Content: Announcement List: RSS (List of announcements)
-
Content: Announcements Latest (List of announcement teasers)
-
Content: Announcements Latest: By Tags (List of announcement teasers, related by 'tags' taxonomy)
-
Content: Announcements Promoted (List of announcement cards, promoted to front page)
-
Content: Announcements Related (List of announcement cards, related by shared terms)
-
Content: Announcements Related: Announcement Type (List of announcement cards, related by 'announcement type' taxonomy)
-
Content: Announcements Related: Tags (List of announcement cards, related by 'tags' taxonomy)
-
Content: Conditional Title (Current node title that doesn't display if a Feature image is present)
-
Content: Event Feature (Featured Content view mode on event node)
-
Content: Event list (List of event cards with exposed filters)
-
Content: Event list: RSS (List of events)
-
Content: Events Latest (List of event teasers)
-
Content: Events Latest: By Tags (List of event teasers, related by 'tags' taxonomy)
-
Content: Events Calendar (Calendar of events)
-
Content: Events Promoted (List of event cards, promoted to front page)
-
Content: Events Related (List of event cards, related by shared terms)
-
Content: Events Related: Event Category (List of event cards, related by 'event category' taxonomy)
-
Content: Events Related: Tags (List of event cards, related by 'tags' taxonomy)
-
Content: Homepage (Featured Content view mode on homepage node)
-
Content: Homepage Paragraphs (Custom Content view mode on homepage node)
-
Content: Landing Feature (Featured Content view mode on landing page node)
-
Content: Landing Paragraphs (Custom Content view mode on landing page node)
-
Content: Profile Directory (Alpha pager of Profiles in table format at /directory)
-
Content: Profile List (List of profiles in Teaser view mode)
-
Content: Profile List Grouped (List of profiles in table format, grouped by last name letter)