Issue #2724✓ SolvedOpened April 21, 2020by jozue062 reactions

Pages in one canvas

快速解答by Ju99ernaut2

You can make use of css properties break-before or break-after. You can maybe create a page break block that you add manually after every page, check out grapesjs-plugin-page-break, or you can break before or after a certain element.Always page break before <h1> element, reference Always page break after <footer> elem...

Read full answer below ↓

Question

Hello, not sure exactly where this should go, but here goes.

I'm creating a builder for making long menus for restaurants that will be printed.

My question is, does anyone have any in the wild examples of making a page-size bounding box for each page of a "menu"?

lets say i have 150 types of beer. i'd like to make each page hold a certain amount of content, then jump to a next page, and have that visible in the canvas, basically taking the newsletter demo, and instead of infinite scroll, making a section inside the canvas <body> have multiple "page" sections of a certain size.

If aren't any examples or ideas, where would be a good place to start other than the top level grapejs docs?

Thanks all!

Answers (1)

👍 Most helpfulJu99ernautApril 28, 2020

You can make use of css properties break-before or break-after. You can maybe create a page break block that you add manually after every page, check out grapesjs-plugin-page-break, or you can break before or after a certain element.

Always page break before <h1> element, reference

@media print{
   h1 {break-before: always;}
}

Always page break after <footer> element, reference

@media print{
   footer {break-after: always}
}

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.