Archived topic
Combining blocks with section on one page failure
11 replies · Started by Alexander on October 5, 2021
Hi! I'm trying to combine sections with block editor on one page with some failure.
As the slider doesn't display well in blocks I put its shortcode in sections on top of the page. The rest of the content (H1 and some text) is supposed to go under the slider. I have made the content on a separate page with block editor and trying to add its code through the hook "generate after main content". Although the content is wrapped in container with fixed width and the parent page isn't full width, the content tends to display full width. Is it really possible that the sections and block editor work well together?
Hi there,
i am a little unclear on what you're trying to achieve.
Are you copying GP Sections HTML into a HTML Block? Why not just use the Blocks to create the same layout ?
Sorry if i missed something. Let me know.
Hi David,
On these page the slider is in Sections and the content beneath is made with block editor via the hook. The reason I put the slider only in Sections is that it doesn't display correctly through the block editor, otherwise I would only use the block editor for all the content.
I'm trying to:
- use more advanced options of the block editor here, but the content below the slider doesn't display correctly (only full width).
- achieve the layout of the page made with the Sections only.
I would do this:
1. Create a new page, and set the Content Container to Full Width.
2. Add the slider shortcode to the top of the page.
3. Below the slider add a GB Container Block, this will allow you to set the inner container width for that section.
3.1 Repeat adding more Container Blocks to create different sections on the page if required.
Do you mean to use only the block editor on the page for the slider and the content below it?
Thats correct.
The problem is that the slider shortcode works fine only in the classic editor and Sections, so it's not doable. When put in the block editor it becomes just a list of images. If not to take the slider into account, technically speaking, can the Sections work with the block editor on one page?
What Slider are you using? As i don't see why it wouldn't work in the Block Editor.
Can i see this ?
As an alternative you can use a Hook Element to insert the Slider Shortcode, use the generate_before_header hook and set it to display on that page.
I'm using Royal Slider. Do you need access to the website?
If you can share a link to a page where i can see the 'broken' Royal Slider i can take a look at why its breaking.
Hi again! After digging into the problem I've found out the slider doesn't want to load all assets sometimes. I have enabled forced loading of all its assets on every page, that made the slider to work with the block editor and then switched off CSS and JS on other pages. Everything works fine now. Thanks for your help, David.
Glad to hear that!