Forum

Thread tagged as: Question, Problem

Auto create content in masterpage

Hi,

I have created a masterpage and used perch_content_create like this.

<div class="container">
    <div class="row">
        <div class="col-md-5 col-sm-12">
            <h2>
                <?php perch_content_create('Overskrift', array(
                      'template' => 'text.html',
                      'multiple' => false,
                    )); 
                ?>
            </h2>
        </div>
        <div class="col-md-12">
            <hr />
        </div>
    </div>

    <div class="row">
        <div class="col-md-6 col-sm-6 col-xs-12">


            <?php perch_content_create('Venstrespalte indhold', array(
                  'template' => 't1_left.html',
                  'multiple' => false,
                )); 
            ?>

        </div>

        <div class="col-md-6 col-sm-6 col-xs-12">

            <?php perch_content_create('Højrespalte indhold', array(
                  'template' => 't1_right.html',
                  'multiple' => false,
                )); 
            ?>            

        </div>

    </div>
</div>

It shows the correct regions in the Perch backend, but nothing show in the frontend?

I'am doing anything wrong?

Cheers, Simon

Simon Rothenborg

Simon Rothenborg 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You're creating the regions but not using them.

Try:

<?php 
    perch_content_create('Højrespalte indhold', array(
        'template' => 't1_right.html',
        'multiple' => false,
    )); 
    perch_content('Højrespalte indhold');
?>   

Ofc. Thanks.