Kirby Builder Problems with nested fields

Hey guys, hey @timoetting,

thanks for your work so far. I’m using Kirby Builder in nested ways with custom CSS loaded in the preview. Basically the Structure is like that: Page -> Container (Kirby Builder) -> Module (Kirby Builder). I have the Modules as Preview and the Containers which pull the contents of the modules just as described via the toBuilderBlocks()-Method. Anyways i’m getting weird errors from app.js and errors referencing to the Builder fields:

I tried debugging but still get no clue. Another weird issue is, that the Custom CSS for Container or Module (both use bundle.css) is not pulled properly: The Module pulls the CSS but the Container doesn’t. So the preview for the modules inside the Container is broken. This is in both production and local environment. Any ideas on that? Would be urgent because this is mostly the backend-view of the page and the entrypoint for the user…

Greets Tobi

Hm, it would be helpful if you post your blueprint, preview snippets, css etc.

Happy cake day :slightly_smiling_face:!

Hey there, i think i solved the problem. By using nested builder-fields and both having defaultView: preview broke the previews. By removing the defaultView from the container, the problem was solved. Appearently it almost looks the same as before and i think i can live with that. But maybe it is worth checking it out, why the errors happen or referencing it in the Docs if this was really the problem.

Anyway i get another strange error – i think it doesn’t belong here – that when i’m reloading the panel-page i get the 500-Error just as described here: Internal Server Error 500 when reload any panel page. This is the content of my .htaccess, just basic stuff i think:

# Kirby .htaccess

# rewrite rules
<IfModule mod_rewrite.c>

# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on

# make sure to set the RewriteBase correctly
# if you are running the site in a subfolder.
# Otherwise links or the entire site will break.
#
# If your homepage is http://yourdomain.com/mysite
# Set the RewriteBase to:
#
# RewriteBase /mysite

# In some enviroments it's necessary to
# set the RewriteBase to:
#
RewriteBase /

# block text files in the content folder from being accessed directly
RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]

# block all files in the site folder from being accessed directly
# except for requests to plugin assets files
#RewriteRule ^assets/plugins/([a-zA-Z0-9\.\-_%=]+)/(.*)$ site/plugins/$1/assets/$2 [L,N]
#RewriteCond $1 !^plugins/[a-zA-Z0-9\.\-_%=]+/assets/.*
RewriteRule ^site/(.*) index.php [L]

# block direct access to kirby and the panel sources
RewriteRule ^(kirby|panel\/app|panel\/tests)/(.*) index.php [L]

# make panel links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^panel/(.*) panel/index.php [L]

# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

</IfModule>

# Additional recommended values
# Remove comments for those you want to use.
#
# AddDefaultCharset UTF-8
#
# php_flag short_open_tag on

Your .htaccess look different from the original Kirby 3 one:

See: https://github.com/getkirby/starterkit/blob/master/.htaccess

Okay @texnixe, thanks for the hint. Since i mostly use forks from https://github.com/brocessing/kirby-webpack i therefore use the included .htaccess:

Maybe worth noticing for @pqml (i think it was your repo)?

Does changing the .htaccess make any difference?

Yes, it indeed fixes the behaviour. Nice. Thanks so far. Think this can be closed then…

Thanks for the quick response and the good help. Always a pleasure. But think it would be necessary to update it on the brocessing-repo.