Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Welcome message on new site / homepage #856

Closed
wants to merge 8 commits into from

Conversation

DonRichards
Copy link
Member

@DonRichards DonRichards commented Nov 30, 2021

GitHub Issue: (link)

What does this Pull Request do?

Makes the homepage an editable TWIG file by routing all traffic to the URL alias "/islandora_welcome" use the welcome.html.twig file.

What's new?

  • Adds a route '/islandora_welcome`
  • Adds a "HomeController" to set the needed twig override
  • Update hook to change the homepage from the current (node/6) to the new /welcome route.
  • Adds 2 TWIG files to showcase how to leverage TWIGS to simplify development.

How should this be tested?

Before you start, using terminal go to the system's default theme directory and check that within the "templates" directory there is no welcome & welcome_base twig files. Running through these steps should result in those files being copied into this directory. The demo build uses Solid so the directory is /var/www/drupal/web/themes/contrib/solid/templates/.

  1. Got to homepage. It should be editable as a node.
  2. Run drush command to run the reset_homepage function drush php-eval "module_load_install('islandora'); reset_homepage();"
  3. Now check homepage (no longer editable and the description should now include where to go for information on how to modify this page. The link won't work until the docs MR is merged. There is no reason to wait for it.
  4. Now got to the /islandora_welcome page and the slideshow banner should also be showing. This indicates that this alias URL is recognized by drupal as .
  5. Now from within terminal go to the system's default theme directory and check that within the "templates" directory now sits welcome & welcome_base twig files.
  6. Modify the new /var/www/drupal/web/themes/contrib/solid/templates/welcome.html.twig file and refresh your page. The changes should happen without needing to clear cache (normally).
  7. Now try to override the homepage from within the system's config page via the browser. https://islandora.traefik.me/admin/config/system/site-information Change it to another node like node/6.

This last step should show that it makes the change once but can be overridden. And because the reset was written as a function reset_homepage() it can be manually triggered at a later time if the user wishes.

Documentation Status

Additional Notes:

N/A

Interested parties

@Islandora/8-x-committers

@DonRichards
Copy link
Member Author

DonRichards commented Dec 1, 2021

Tech call asked to remove the update hook and rename the route due to potential community URL conflicts. Switched to 'islandora_welcome'. Also there was some discussion on whether or not it should be moved into the install profile/islandora defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant