Forum

Thread tagged as: Question, Problem, Forms

New page not showing in admin

I have added the <?php include('perch/runtime.php');?> at the top of a page and created the template but the page does not show in the admin. What have I missed?

php code

<?php include('perch/runtime.php');?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Contact</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link href="css/style.css" rel="stylesheet" type="text/css">

<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Droid+Sans" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="js/main.js"></script>



</head>

<body>

<div id="wrapper">

    <nav id="cssmenu">
    <div class="logo">
        <a href="index1.php"><img src="imgs/CairnTraining-Logo.jpg" width="200px" height="50px" alt="Logo"></a>
    </div>
    <div id="head-mobile"></div>
    <div class="button"></div>
    <ul>
    <li><a href="index1.php">HOME</a></li>
    <li><a href="about.php">ABOUT</a></li>
    <li><a href="#">QUALIFICATIONS</a>
        <ul>
            <li><a href="svq2.html">SVQ 2</a></li>
            <li><a href="svq3.html">SVQ 3</a></li>
            <li><a href="svq4.html">SVQ 4</a></li>
        </ul>
    </li>
    <li><a href="#">WORKSHOPS</a>
        <ul>
            <li><a href="child-development.html">Child Development</a></li>
            <li><a href="communication-children.html">Communication with Children</a></li>
            <li><a href="child-protection.html">Child Protection</a></li>
            <li><a href="birth-three.html">Pre-Birth to Three</a></li>
            <li><a href="curriculum-exellence.html">Curriculum for Excellence</a></li>
        </ul>
    </li>
    <li><a href="funding.html">FUNDING</a></li>
    <li><a href="news.php">NEWS</a></li>
    <li class="active"><a href="contact.php">CONTACT</a></li>
    </ul>
    </nav>

    <div class="c-banner">
        <h2>Contact Us</h2>
    </div>

    <div class="location-box">
        <div class="location">
            <i class="fa fa-map-marker fa-icon4" aria-hidden="true"></i>
            <h3>Our Location</h3>
            <p>1 Raeburn Place, Aberdeen, <br/> AB25 1PP</p>    
        </div>
    </div>
    <div class="phone-box">
        <div class="phone">
            <i class="fa fa-phone fa-icon4" aria-hidden="true"></i>
            <h3>Get in Touch</h3>
            <p>01224 646144</p> 
        </div>
    </div>

    <div class="contact-form">
        <?php perch_content('contact form'); ?>
    </div>

    <footer>
        <div class="copyright">
            <p>Cairn Training 2017</p>
        </div>
    </footer>

</div>

</body>
</html>

template code

<h2><perch:content id="heading" type="text" label="heading" required="true" /></h2>
<perch:form id="form-contact"  method="post" app="perch_forms" role="form">

    <div class="contact">
        <h3>Leave A Message</h3>
    </div>
    <div class="half left cf">
        <perch:label for="name">Your name:</perch:label>
        <perch:input type="text" id="input-name" placeholder="Name" required="true" label="Name"/>

        <perch:label for="email">Your email:</perch:label>
        <perch:input type="email" id="input-email" placeholder="Email address" required="true" label="Email"/>

        <perch:input type="select" id="list" options="General Enquiries,Qualifications,Workshops,Funding" label="subject"/>

    </div>
    <div class="half right cf">
        <perch:label for="message">Your message:</perch:label>
        <perch:input name="message" type="textarea" id="input-message" placeholder="Message" required="true" label="Message"/>
    </div>

    <div class="submit">
        <perch:input type="submit" value="Send" id="input-submit" />
    </div>

    <perch:success>
    <div class="alert success">
    <perch:content id="success" type="textarea" size="m" label="Thank you message" markdown="true" editor="simplemde" required="true"/>
    </div>  
    </perch:success>

</perch:form>

Joanna Mein

Joanna Mein 0 points

  • 4 years ago
Simon Clay

Simon Clay 127 points

Hi Joanna,

What is the page location in respect to the Perch folder?

Your include at the top will work if the page is in the same directory as the Perch folder.

But if your page is in a sub directory e.g. /contact/index.php it won't work.

In most instances I usually use the following to allow for the page to be in any sub directory (provided Perch is installed in the root)

<?php include($_SERVER['DOCUMENT_ROOT'].'/perch/runtime.php'); ?>

Have you visited the page and were there any errors?

Yes the .php file it is in the root folder and so in the perch folder. I have loaded the php page and there are no errors.

Apologies the page has appeared in the admin panel, it must have been a browser caching issues.

Joanna, were you referring to the editable region - not showing?