barrio_path_images required to be configured when creating a subtheme

Created on 1 September 2023, about 1 year ago
Updated 21 February 2024, 9 months ago

When creating a sub theme, it is necessary to add an image path. Otherwise image path is broken that can result in a 404(s)

e.g.

2023-09-01 15:19:51	Error	xx.xx.xx.xx	404	GET /themes/custom/contrib/bootstrap_barrio/images/icons/text-plain.png HTTP/1.0	https://mywebsite/article/getting-started-ddev-and-apache-solr-service-addon	Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36	919	Apache SSL/TLS access
2023-09-01 15:19:51	Error	xx.xx.xx.xx	404	GET /themes/custom/contrib/bootstrap_barrio/images/icons/text-html.png HTTP/1.0	https://mywebsite/article/getting-started-ddev-and-apache-solr-service-addon	Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36	918	Apache SSL/TLS access
2023-09-01 15:19:51	Error	xx.xx.xx.xx	404	GET /themes/custom/contrib/bootstrap_barrio/images/required.svg HTTP/1.0	https://mywebsite/article/getting-started-ddev-and-apache-solr-service-addon	Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36	35.1 K	Apache SSL/TLS access
2023-09-01 15:19:51	Error	xx.xx.xx.xx	404	GET /themes/custom/contrib/bootstrap_barrio/images/icons/text-x-generic.png HTTP/1.0

Note how contrib is prefixed by custom. Really I want the image path set to my sub theme.

e.g.

$barrio_path_images: "../images/";

This can be declared in sub-theme variables.scss file.

πŸ› Bug report
Status

Needs review

Version

5.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom 2dareis2do

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @2dareis2do
  • First commit to issue fork.
  • @sim_1 opened merge request.
  • Status changed to Needs review about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States sim_1

    I accidentally committed the change with the default commit message, but there is now a MR ready for review. I added $barrio_path_images: "../images/"; to the _variables.scss file like the issue description suggested. This fixed the build issue when I tried it in my sub theme.

  • πŸ‡ΊπŸ‡ΈUnited States sim_1

    The other thing I'll say though, is that this is also fixed in the barrio project in version 5.5.11. So it might not make sense to add this variable, but instead mark this as an issue that is fixed upstream.

  • πŸ‡¬πŸ‡§United Kingdom 2dareis2do

    Hi @sim_1

    Thanks for looking into this.

    I think you are correct in your analysis.

    I will raise an issue on the barrio project and reference this here. If I understand correctly I think your suggestion that $barrio_path_images: "../images/" should go in the parent theme is correct.

    https://git.drupalcode.org/project/bootstrap_barrio/-/commit/e6fa5dc458d...

  • πŸ‡¬πŸ‡§United Kingdom 2dareis2do
  • πŸ‡ΊπŸ‡ΈUnited States tommyk

    The fix of adding $barrio_path_images: "../images/"; to the subtheme SCSS works for me. The parent theme works on its own, but using this theme does not without that variable set.

Production build 0.71.5 2024