Forum

Thread tagged as: Question, Problem

blocks not loading an included perch:template

I have a master template that creates a region and then pre-populates it with a template. The template it populates the region with uses blocks for content. Once a block is chosen the template the loads has a perch:template included at the top. When I create the pages the last step in the process (the template include) on a loaded block template does not show.

But if I use a standard perch_content() tag and then choose the free_form_template.html the template include shows on top of the block choice. Is there a restriction that doesn't allow you to use a template include when creating a region using perch_content_custom?

Here is all the code. It may explain it better when seeing the actual code. I'm only including the relevant parts to understand this question.

MASTER TEMPLATE:


<?php perch_content_create('Page Content', array( 'template' => 'Structured_Content/page_content_template.html', 'multiple' => true, )); ?> <?php perch_content_custom('Page Content', array( 'template' => 'Page_Template/free_form_template.html', )); ?>

PAGE_CONTENT_TEMPLATE


<perch:template path="content/Page_Template/free_form_template.html" />

FREE-FORM-TEMPLATE:


<perch:blocks> <perch:block label="ADD 2 Columns" type="cols2text" order="1"> <perch:template path="content/Number_of_Columns/2_colums.html" /> </perch:block> <perch:block label="ADD 3 Columns" type="cols3text" order="2"> <perch:template path="content/Number_of_Columns/3_colums.html" /> </perch:block> <perch:block label="ADD 4 Columns" type="cols4text" order="3"> <perch:template path="content/Number_of_Columns/4_colums.html" /> </perch:block> (MORE BLOCKS HERE) </perch:blocks>

2 COLUMN BLOCK TEMPLATE


** <perch:template path="content/section_start_template.html" /> <<< THIS IS THE TEMPLATE THAT DOESN'T LOAD ** <perch:repeater id="2Cols" label="REQUIRED MINMUM: 2 ITEMS" notes-before="2 Columns with Content"> <perch:before> <div class="row"> </perch:before> <div class="col-sm-6"> <perch:if exists="title"> <div class="section_sub_title"> <perch:content id="title" type="text" label="Content Headline" title="true" divider-before="Column Content" /> </div><!--* ./sub title *--> </perch:if> <perch:if exists="image"> <div class="section-image"> <img src="<perch:content id="image" type="image" label="You can add an image for your content." divider-before="Image Choice" />" alt="<perch:content id="imagealt" type="text" label="Alt Text" help="Place alt text here to describe your image. It is helpful to use a keyword" />" class="img-repsonsive" /> </div><!--* ./ section image *--> </perch:if> <perch:content id="col" type="textarea" label="Text" markdown="true" textile="true" editor="markitup" required="true" /> </div><!--* ./cols-6 *--> <perch:every count="2"> </div> <div class="row"> </perch:every> </perch:repeater> <perch:after> </div><!--* ./row *--> </div><!--* ./container from section_start_template_file *--> </section> </perch:after>

SECTION START TEMPLATE:


<section class="<perch:content label="Background color for Section" id="class" type="select" options="dark gray bg|content dark, white bg|content white, solid black bg|content black, boxes with colored headline box |boxes" />_section"> <div class="container"> <perch:if exists="title OR support_text"> <div class="row"> <div class="col-sm-12 col-md-10 col-md-offset-1"> <perch:if exists="title"> <h1> <perch:content id="title" type="text" label="Main Title for Content" title="true"/> </h1> </perch:if> <perch:if exists="support_text"> <perch:content id="support_text" type="textarea" textile="true" editor="markitup" label="Support Content for Title" help="Add support description here" /> </perch:if> </div><!--* ./col-12 *--> </div><!--* ./row *--> </perch:if>
Kim Mazzola

Kim Mazzola 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think you can include multiple levels of template at the moment. It might only go one deep. i.e. you can include a template, but not include a template that includes another template.

Thank you, so do you think that could also be the reason I'm having this issue? I still can't get my pages to resolve [from this post] (https://forum.grabaperch.com/forum/02-08-2017-perch-moving-pages-is-not-working).

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, that doesn't sound in the least bit related.

OK, well, I am still experiencing this problem and I have no idea how to get the pages to resolve when placed in directory under the root. Please read my latest reply to you in that post. I can't build the multi-page site without this working properly. Thank you for answering on the weekend, I really appreciate that!