I’m building a site and I’m close to the launch date. With Kirby 4 close to being released, I tried RC1 … but it looks like some of the layouts break in the right column (I attached a screenshot) … it might have to do with me using quite long help texts in the blueprints so the editor knows what to do (and not to do).
I’m not here for you in order to help me, but in order to show you stuff that’s still wonky in Kirby 4.
The way I set up my blueprints works in Kirby 3, so I guess it must be some sort of bug?
Regarding the help text for the videos, I would recommend solving the whitespace issue in your code instead of relying on the user to follow your advice.
I am using ->isNotEmpty() a lot … but that doesn’t work for blocks.
If the editor creates, say, a quote block … and then doesn’t enter anything, the HTML for said quote block still gets rendered, just with an empty <blockquote> and an empty <footer> inside.
Now, I had to write a custom quote.php block snippet anyway, so I told it to not output anything if the fields are empty, but the container surrounding all quotes stays … because afaik I cannot tell the template to check whether or not the blocks were created BUT are empty. Can I?
So … the same is true for videos and all other blocks, no?
Thank you @GB_DESIGN … I’ll check that out … actually … The images are going to be uploaded from the panel. The link you sent is about uploading from the front end. So … how can I sanitise filenames of files uploaded from the panel?
You have a double query as to whether citation() exists.
The block is only rendered if text() or citation() are not empty.
Is it desirable that the complete block should not be rendered in this case?
Is the input for citation() optional or only intended in combination with text()?
The following (untested) code has a more logical structure:
Right, not as easy as I thought. $block->isEmpty() doesn’t work as expected. I would be necessary to create block models that define for each block type when they are to be considered empty. Nevertheless, while this is more work, you would be on the safe side and not rely on user input.
I know … I was wondering whether that would actually be something that could become a Kirby feature.
Because I’m probably not the only one who creates a website and then hands it to editors who have no idea that making empty blocks in the panel results in unnecessary HTML in the frontend.
I’ve got two reasons I haven’t looked into programming this myself:
The deadline I have for this project is close and there’s higher priority stuff to be done
We’re waaaaaaayyyyy over budget already.
I might look into coming up with a solution with the next Kirby project… not with this one.
(But hey, if anyone out there is interested in coming up with a solution … it would be much appreciated!)
And back to what this thread was originally about:
Is the fixed-height for help text issue something that’s gonna be fixed for Kirby 4 production?
Height depending on text length is a reasonable way to go, no?
Or do we all need to use the workaround?