Umbraco.Community.BlockPreview icon indicating copy to clipboard operation
Umbraco.Community.BlockPreview copied to clipboard

Block List Allowed Content Types Settings Issues

Open StephenBenson-MRM opened this issue 1 year ago • 2 comments

Which Umbraco.Community.BlockPreview version are you using?

2.0.2

Which Umbraco version are you using? For example: 10.4.0 - don't just write v10

14.2.0

Bug summary

Hello!

Love your work!

Block List Allowed Content Types values added in appSettings don't seem to be respected

It seems to just be Block Previews for all Block List, or none

There is also some strange behaviour if you have any URL/ Document Pickers or Dropdowns inside a block, and, when you start nesting block grids / lists

I can't give you good repro steps for that and it could be a 14 issue and not the package based on how it saves the Data Types? I can raise a seperate bug if I can figure it out

Also, "umbraco" seems to be prepended to stylesheet links for Block Grids when viewing a preview.

Again, could be 14, but, have a rewrite to sort this one out. This happens whether the css file path is /path, ./path, or ~/path

Steps to reproduce

Add Content Type Aliases to the allowed content types for block list in appsettings View the result

Expected result / actual result

Adding the alias for an Element/Document type into this list should show the preview, and not show previews for other block lists

StephenBenson-MRM avatar Aug 30 '24 13:08 StephenBenson-MRM

Hey @s-benson-hugo-and-cat! Thanks for raising the issue. Please can you confirm what is in your appsettings.json? Just the BlockPreview section is fine.

There is definitely some strange behaviour with nesting things inside Blocks, I think for the most part that's a v14 issue that needs resolving.

The stylesheet issue is a known one that I've submitted a fix for in Umbraco 14.3 ( see https://github.com/umbraco/Umbraco.CMS.Backoffice/pull/2213)

rickbutterfield avatar Aug 30 '24 13:08 rickbutterfield

Hello, currently it is

"BlockPreview": { "BlockGrid": { "Enabled": true, "ContentTypes": [ "articleListing", "buttonCollection", "carouselWithModal", "centeredContentBlock", "contacts", "endcap", "featuredContent", "form", "imageDefault", "informationBlock", "landingPageCards", "listing", "quickLinks", "sirWebRichText", "spotlight", "stats", "tabGroup", "testimonial", "textList", "youTubeVideo" ], "Stylesheet": "/assets/SirWeb/css/app.css" }, "BlockList": { "Enabled": false }

If I change it to

  "BlockPreview": {
"BlockGrid": {
  "Enabled": true,
  "ContentTypes": [
    "articleListing",
    "buttonCollection",
    "carouselWithModal",
    "centeredContentBlock",
    "contacts",
    "endcap",
    "featuredContent",
    "form",
    "imageDefault",
    "informationBlock",
    "landingPageCards",
    "listing",
    "quickLinks",
    "sirWebRichText",
    "spotlight",
    "stats",
    "tabGroup",
    "testimonial",
    "textList",
    "youTubeVideo"
  ],
  "Stylesheet": "/assets/SirWeb/css/app.css"
},
"BlockList": {
  "Enabled": true
}

I see blocklist previews. If I then do:

  "BlockPreview": {
"BlockGrid": {
  "Enabled": true,
  "ContentTypes": [
    "articleListing",
    "buttonCollection",
    "carouselWithModal",
    "centeredContentBlock",
    "contacts",
    "endcap",
    "featuredContent",
    "form",
    "imageDefault",
    "informationBlock",
    "landingPageCards",
    "listing",
    "quickLinks",
    "sirWebRichText",
    "spotlight",
    "stats",
    "tabGroup",
    "testimonial",
    "textList",
    "youTubeVideo"
  ],
  "Stylesheet": "/assets/SirWeb/css/app.css"
},
"BlockList": {
  "Enabled": true,
  "ContentTypes": ["myBlockListIndividualElementAlias", "anyAliasFromTheAboveWorkingList"]
}

It will not show a preview for any of those elements

StephenBenson-MRM avatar Aug 30 '24 16:08 StephenBenson-MRM

Hey @StephenBenson-MRM!

I have now confirmed that this is an issue with the Umbraco backoffice, and have raised a PR for it: https://github.com/umbraco/Umbraco.CMS.Backoffice/pull/2515

rickbutterfield avatar Nov 06 '24 16:11 rickbutterfield

This will be resolved in Umbraco 15.1, due for release on Thursday 12th December

rickbutterfield avatar Nov 22 '24 16:11 rickbutterfield

Fantastic, thank you for the reply! 😄

StephenBenson-MRM avatar Nov 22 '24 16:11 StephenBenson-MRM

@StephenBenson-MRM 15.1.0-rc has just been released and I can confirm that this is fixed! So you'll be able to use BlockPreview 3.0.0

rickbutterfield avatar Nov 28 '24 10:11 rickbutterfield