Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Conversation

@rickbutterfield
Copy link

@rickbutterfield rickbutterfield commented Nov 5, 2024

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

14.3.1, but also affects 15.

Description

When configuring a layoutStylesheet against a BlockGrid datatype, the path to the CSS isn't resolved correctly when the front end is built and included in the NuGet package for release. The URL it is trying to be loaded from includes the backoffice path as part of the URL.

When running the Backoffice project locally, appUrl will always resolve to http://localhost:5173, whereas when running within the context of a C# project, appUrl will resolve to the absolute backoffice path, e.g. https://localhost:44338/umbraco.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Motivation and context

This is a secondary fix that attempts to resolve an issue not fully resolved in #2213. The backoffice URL does not need to be included in appUrl in this context as all resources are likely to reside in wwwroot, which is then handled in transformServerPathToClientPath.

Also see umbraco/Umbraco-CMS#16897.

Fixes the above linked issue so that BlockGrid layouts can be rendered correctly in the backoffice, and in Custom Views, with applied CSS.

This also fixes the same issue with Block icons.

How to test?

Will need to be tested against a built version of the backoffice running in a .NET project (unsure how to do this, sorry!)

Screenshots (if appropriate)

Unable to show screenshots as this only affects the built project when running on a .NET project

Checklist

  • If my change requires a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@rickbutterfield rickbutterfield changed the title [v14+] Fix Block Grid layoutStylesheet not using correct URL [v14.2+] Fix Block Grid layoutStylesheet not using correct URL Nov 5, 2024
@leekelleher leekelleher enabled auto-merge (squash) November 6, 2024 12:28
Copy link
Member

@leekelleher leekelleher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rickbutterfield! #h5yr 🎉
I've tested it out and made a couple of tweaks to the PR.

@leekelleher leekelleher merged commit 5a38fec into umbraco:main Nov 6, 2024
8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants