cu-uis / cu-starterkit-project

Development repository for Pantheon's recommended (future) Drupal 9+ upstream
1 stars 2 forks source link

Evaluate - Options to create nodes or define custom routes for 404 pages and initial pages #75

Open kreynen opened 2 years ago

kreynen commented 2 years ago

Describe the options

CU Online uses a page node defined in the common /admin/config/system/site-information configuration for https://online.cu.edu/404. That site was changing URLs so often, they would often have ads directing users to a 404. We discussed developing a process for resolving these in https://gitlab.cu.edu/uis-webdev/online-cu-starterkit/-/issues/491, but at some point the GTM code stop being added to the 404 response and no one noticed the complete lack of 404s in GA.

https://www.ucf.edu/online/404 - search https://online.mines.edu/404 - search (but currently broken) https://www.online.colostate.edu/404/ - link to search https://asuonline.asu.edu/404 - no search https://online.iu.edu/404 - no search

The reason for including a search in the 404 is to provide more information about what the user was looking for when they ended up on the 404 so a redirect can be added and/or the link the user followed to the 404 can be updated.

Bookish/Tome is using https://github.com/drupal-tome/bookish/blob/1.0.x/bookish.install#L268

Centarro/Commerce Kickstart is using https://git.drupalcode.org/project/commerce_kickstart/-/blob/3.x/commerce_kickstart.install#L58 to create shortcuts, but they add demo content by adding https://git.drupalcode.org/project/commerce_kickstart/-/blob/3.x/composer.json#L26 to the project which then uses https://www.drupal.org/project/default_content to add https://git.drupalcode.org/project/commerce_demo/-/tree/3.0.x/content using https://git.drupalcode.org/project/commerce_demo/-/blob/3.0.x/commerce_demo.info.yml.

Ryan talked about not being completely happy with the default_content approach in https://youtu.be/orGgOengALg?t=1750

In Web Express, we used install functions in the profile like https://github.com/CuBoulder/express_mono/blob/dev/express.install#L103, but handled the homepage node creation in https://github.com/CuBoulder/express_mono/blob/dev/modules/features/cu_home_page/cu_home_page.install#L19

I'm sure there are a dozen other ways to approach this as well and it's not even clear whether we should use the same approach for 404 handling as the initial content created by the install profile.

kreynen commented 2 years ago

https://git.drupalcode.org/project/distributions_recipes/-/blob/1.0.x/docs/recipe_roadmap.md points to https://www.drupal.org/project/drupal/issues/2094481 as part of the initiative which is an active core improvement still targeting 9.3.x