Issue #2724Opened April 21, 2020by jozue062 reactions

[QUESTIONS] pages in one canvas

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)

Ju99ernautApril 28, 20202 reactions

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.