Page Layouts / Add Regions

  • Also it should have a way to restrict adding certain things (regions, blocks etc) so the editor will stay within the rules of the design.


    Eg don’t put two photos next to each other. Or a piece of text should always have a header. Or after 3 text blocks there should be an image. A page should always start with a text and never with an image.


    Things like that.

  • Creating well-thought-out region that uses blocks seems to be the answer for me.


    The default master page for most of marketing sites I build on Runway nowadays is literally just this:


    PHP
    1. perch_layout('global.top');
    2. perch_content_create('Blocks', ['template' => 'blocks.html']);
    3. perch_content('Blocks');
    4. perch_layout('global.bottom');


    You can enforce design rules and follow brand guidelines. And you're not restricted to content templates. For instance, you can create a "global" block that allows the editor to select a global section (e.g. featured products, latest blog posts, forms, etc): https://grabapipit.com/blog/a-global-block


    So I feel what you're asking for is already addressed by Blocks (at least for the most part). If it falls short in some areas, perhaps it is better to explore those areas first.



    (maybe even have a code ide built-in


    Perhaps a textarea field with a lightweight code editor can be helpful. For example, you may set up a shared region for editors to insert analytics tags like Google Analytics. Or perhaps you have a blog and would like to add custom CSS to style some posts differently.


    One of the reason I hated maintaining WordPress sites I inherited was how some of them would have HTML and inlined CSS code inserted via the control panel. I want a CMS to manage content, not code. I want to version control source code and I think storing source code in the database would cause more issues than it solves particularly for client sites.