rickbutterfield / Umbraco.Community.BlockPreview

Easy to use rich HTML backoffice previews for the Umbraco Block List and Block Grid editors.
MIT License
15 stars 10 forks source link

Block List Allowed Content Types Settings Issues #65

Open s-benson-hugo-and-cat opened 2 weeks ago

s-benson-hugo-and-cat commented 2 weeks ago

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

rickbutterfield commented 2 weeks ago

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)

s-benson-hugo-and-cat commented 2 weeks ago

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