Hello Crack Team of Couch!
Please excuse all the details. The crux of my problem is at the end in bold.
I've run into a problem with Page Builder that is baffling me. Per the instructions when it comes to the html wrapping for the iframe:
this is my pb_wrapper.html
This is the embedded 'head' code:
And this is the embedded 'tail' code:
These are obvioulsy just the minimum I need for the iframe rendering correctly. This is my pagebuilder template:
and here is my pagebuilder rendering code on the page:
My problem comes when I look at the rendered page. The 'tail' code is rendering twice. Once after my final block renders and then again as the full page (which is the normal time it should). The block looks fine in the Admin panel, but when I get to the actual site, the duplication of the 'tail' affects the page. I've removed my 'tail' embed from pb_wrapper.html and it will look perfect on the rendered site page, but looks horrible in the Admin panel (as you can imagine).
My 'head' code is not doubled on the site rendered page. It seems as if the code that strips away pb_wrapper.html when the page renders is missing stripping out the 'tail' portion, or something in the pb_tile_content is causing that process to stop running.
Is it possible that since my Snippets are in another folder than default ( https://www.couchcms.com/forum/viewtopic.php?f=5&t=13148&start=30#p39332 this is affecting the process?
Otherwise, I have scoured the forum and gone over the instructions line-by-line and I can't figure out why this is happening. Any ideas? I'm happy to PM site creds for a quick peek if needed.
the page is online here where you can see the code duplicating (if you look at source)
https://smbcustomwebs.com/sandbox/staging/mods-pagebuilder/pages.php
Please excuse all the details. The crux of my problem is at the end in bold.
I've run into a problem with Page Builder that is baffling me. Per the instructions when it comes to the html wrapping for the iframe:
For wrapper, because we only have a single one, we'll go with the default name pagebuilder searches for - that is 'pb_wrapper'.
Copy the code for the wrapper we extracted above in a file named 'pb_wrapper.html' and place it within 'couch/snippets/pb/misc/theme/'.
this is my pb_wrapper.html
- Code: Select all
<cms:embed 'page_elements/head.htm' />
<cms:show pb_tile_content />
<cms:embed 'page_elements/tail.htm' />
This is the embedded 'head' code:
- Code: Select all
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<base href="<cms:show k_site_link />">
<title> Website</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">
<meta content="" name="description">
<!-- Google Web Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Edu+TAS+Beginner:wght@400..700&family=Jost:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
<!-- Icon Font Stylesheet -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css"/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" rel="stylesheet">
<!-- Libraries Stylesheet -->
<link rel="stylesheet" href="<cms:show k_site_link />/lib/animate/animate.min.css"/>
<link href="<cms:show k_site_link />/lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<!-- Customized Bootstrap Stylesheet -->
<link href="<cms:show k_site_link />/css/bootstrap.min.css" rel="stylesheet">
<!-- Template Stylesheet -->
<link href="<cms:show k_site_link />/css/style.css" rel="stylesheet">
</head>
<body>
And this is the embedded 'tail' code:
- Code: Select all
<!-- JavaScript Libraries -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="lib/wow/wow.min.js"></script>
<script src="lib/easing/easing.min.js"></script>
<script src="lib/waypoints/waypoints.min.js"></script>
<script src="lib/owlcarousel/owl.carousel.min.js"></script>
<!-- Template Javascript -->
<script src="js/main.js"></script>
</body>
</html>
These are obvioulsy just the minimum I need for the iframe rendering correctly. This is my pagebuilder template:
- Code: Select all
<cms:pagebuilder name='main_pb' label='PageBuilder' skip_custom_fields='1' order='-1'>
<cms:section label='Team' name='team_module' masterpage='blocks/team.php' mosaic='blocks' />
<cms:section label='Services' name='service_module' masterpage='blocks/service.php' mosaic='blocks' />
<cms:section label='Projects' name='project_module' masterpage='blocks/project.php' mosaic='blocks' />
<cms:section label='About' name='about_module' masterpage='blocks/about.php' mosaic='blocks' />
</cms:pagebuilder>
and here is my pagebuilder rendering code on the page:
- Code: Select all
<cms:capture into='pb_tile_content' >
<cms:show_pagebuilder 'main_pb'>
<cms:show k_content />
</cms:show_pagebuilder>
</cms:capture>
<cms:render 'pb_wrapper' 'page' />
My problem comes when I look at the rendered page. The 'tail' code is rendering twice. Once after my final block renders and then again as the full page (which is the normal time it should). The block looks fine in the Admin panel, but when I get to the actual site, the duplication of the 'tail' affects the page. I've removed my 'tail' embed from pb_wrapper.html and it will look perfect on the rendered site page, but looks horrible in the Admin panel (as you can imagine).
My 'head' code is not doubled on the site rendered page. It seems as if the code that strips away pb_wrapper.html when the page renders is missing stripping out the 'tail' portion, or something in the pb_tile_content is causing that process to stop running.
Is it possible that since my Snippets are in another folder than default ( https://www.couchcms.com/forum/viewtopic.php?f=5&t=13148&start=30#p39332 this is affecting the process?
Otherwise, I have scoured the forum and gone over the instructions line-by-line and I can't figure out why this is happening. Any ideas? I'm happy to PM site creds for a quick peek if needed.
the page is online here where you can see the code duplicating (if you look at source)
https://smbcustomwebs.com/sandbox/staging/mods-pagebuilder/pages.php