HTML templates .php extension

Stagger Lee
1775 Posts
Stagger Lee posted this 27 September 2015

Can you reconsider removing .html and add support for filename.php HTML templates ?

We could add our own PHP code in templates and use much more of options out there.
One example we cannot use now, Bootstrap contact form:

<?php if="" (isset($_post["submit"]))="" {="" $name="$_POST['name'];" $email="$_POST['email'];" $message="$_POST['message'];" $human="intval($_POST['human']);" $from='Demo Contact Form' ;="" $to='example@domain.com' ;="" $subject='Message from Contact Demo ' ;="" $body="From: $name\n E-Mail: $email\n Message:\n $message" ;="" check="" if="" name="" has="" been="" entered="" if="" (!$_post['name'])="" {="" $errname='Please enter your name' ;="" }="" check="" if="" email="" has="" been="" entered="" and="" is="" valid="" if="" (!$_post['email']="" ||="" !filter_var($_post['email'],="" filter_validate_email))="" {="" $erremail='Please enter a valid email address' ;="" }="" check="" if="" message="" has="" been="" entered="" if="" (!$_post['message'])="" {="" $errmessage='Please enter your message' ;="" }="" check="" if="" simple="" anti-bot="" test="" is="" correct="" if="" ($human="" !="=" 5)="" {="" $errhuman='Your anti-spam is incorrect' ;="" }="" if="" there="" are="" no="" errors,="" send="" the="" email="" if="" (!$errname="" &&="" !$erremail="" &&="" !$errmessage="" &&="" !$errhuman)="" {="" if="" (mail="" ($to,="" $subject,="" $body,="" $from))="" {="" $result='<div class="alert alert-success">Thank You! I will be in touch</div>' ;="" }="" else="" {="" $result='<div class="alert alert-danger">Sorry there was an error sending your message. Please try again later.</div>' ;="" }="" }="" }=""?>


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Bootstrap contact form with PHP example by BootstrapBay.com.">
    <meta name="author" content="BootstrapBay.com">
    <title>Bootstrap Contact Form With PHP Example</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
  </head>
  <body>
    <div class="container">
        <div class="row">
            <div class="col-md-6 col-md-offset-3">
                <h1 class="page-header text-center">Contact Form Example</h1>
                <form class="form-horizontal" role="form" method="post" action="index.php">
                    <div class="form-group">
                        <label for="name" class="col-sm-2 control-label">Name</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="name" name="name" placeholder="First & Last Name" value="<?php echo htmlspecialchars($_POST['name']); ?>">
                            <?php echo=""?><p class='text-danger'>$errName</p>";?>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="email" class="col-sm-2 control-label">Email</label>
                        <div class="col-sm-10">
                            <input type="email" class="form-control" id="email" name="email" placeholder="example@domain.com" value="<?php echo htmlspecialchars($_POST['email']); ?>">
                            <?php echo=""?><p class='text-danger'>$errEmail</p>";?>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="message" class="col-sm-2 control-label">Message</label>
                        <div class="col-sm-10">
                            <textarea class="form-control" rows="4" name="message"><?php echo="" htmlspecialchars($_post['message']);?=""?></textarea>
                            <?php echo=""?><p class='text-danger'>$errMessage</p>";?>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="human" class="col-sm-2 control-label">2 + 3 = ?</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="human" name="human" placeholder="Your Answer">
                            <?php echo=""?><p class='text-danger'>$errHuman</p>";?>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-10 col-sm-offset-2">
                            <input id="submit" name="submit" type="submit" value="Send" class="btn btn-primary">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-10 col-sm-offset-2">
                            <?php echo="" $result;=""?> 
                        </div>
                    </div>
                </form> 
            </div>
        </div>
    </div>   
  </body>
</html>

Can you reconsider removing .html and add support for filename.php HTML templates ? We could add our own PHP code in templates and use much more of options out there. One example we cannot use now, Bootstrap contact form: <?php if="" (isset($_post["submit"]))="" {="" $name="$_POST['name'];" $email="$_POST['email'];" $message="$_POST['message'];" $human="intval($_POST['human']);" $from='Demo Contact Form' ;="" $to='example@domain.com' ;="" $subject='Message from Contact Demo ' ;="" $body="From: $name\n E-Mail: $email\n Message:\n $message" ;="" check="" if="" name="" has="" been="" entered="" if="" (!$_post['name'])="" {="" $errname='Please enter your name' ;="" }="" check="" if="" email="" has="" been="" entered="" and="" is="" valid="" if="" (!$_post['email']="" ||="" !filter_var($_post['email'],="" filter_validate_email))="" {="" $erremail='Please enter a valid email address' ;="" }="" check="" if="" message="" has="" been="" entered="" if="" (!$_post['message'])="" {="" $errmessage='Please enter your message' ;="" }="" check="" if="" simple="" anti-bot="" test="" is="" correct="" if="" ($human="" !="=" 5)="" {="" $errhuman='Your anti-spam is incorrect' ;="" }="" if="" there="" are="" no="" errors,="" send="" the="" email="" if="" (!$errname="" &&="" !$erremail="" &&="" !$errmessage="" &&="" !$errhuman)="" {="" if="" (mail="" ($to,="" $subject,="" $body,="" $from))="" {="" $result='<div class="alert alert-success">Thank You! I will be in touch</div>' ;="" }="" else="" {="" $result='<div class="alert alert-danger">Sorry there was an error sending your message. Please try again later.</div>' ;="" }="" }="" }=""?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="Bootstrap contact form with PHP example by BootstrapBay.com."> <meta name="author" content="BootstrapBay.com"> <title>Bootstrap Contact Form With PHP Example</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> </head> <body> <div class="container"> <div class="row"> <div class="col-md-6 col-md-offset-3"> <h1 class="page-header text-center">Contact Form Example</h1> <form class="form-horizontal" role="form" method="post" action="index.php"> <div class="form-group"> <label for="name" class="col-sm-2 control-label">Name</label> <div class="col-sm-10"> <input type="text" class="form-control" id="name" name="name" placeholder="First & Last Name" value="<?php echo htmlspecialchars($_POST['name']); ?>"> <?php echo=""?><p class='text-danger'>$errName</p>";?> </div> </div> <div class="form-group"> <label for="email" class="col-sm-2 control-label">Email</label> <div class="col-sm-10"> <input type="email" class="form-control" id="email" name="email" placeholder="example@domain.com" value="<?php echo htmlspecialchars($_POST['email']); ?>"> <?php echo=""?><p class='text-danger'>$errEmail</p>";?> </div> </div> <div class="form-group"> <label for="message" class="col-sm-2 control-label">Message</label> <div class="col-sm-10"> <textarea class="form-control" rows="4" name="message"><?php echo="" htmlspecialchars($_post['message']);?=""?></textarea> <?php echo=""?><p class='text-danger'>$errMessage</p>";?> </div> </div> <div class="form-group"> <label for="human" class="col-sm-2 control-label">2 + 3 = ?</label> <div class="col-sm-10"> <input type="text" class="form-control" id="human" name="human" placeholder="Your Answer"> <?php echo=""?><p class='text-danger'>$errHuman</p>";?> </div> </div> <div class="form-group"> <div class="col-sm-10 col-sm-offset-2"> <input id="submit" name="submit" type="submit" value="Send" class="btn btn-primary"> </div> </div> <div class="form-group"> <div class="col-sm-10 col-sm-offset-2"> <?php echo="" $result;=""?> </div> </div> </form> </div> </div> </div> </body> </html>
Vote to pay developers attention to this features or issue.
4 Comments
Order By: Standard | Newest
Support Team posted this 28 September 2015

Hi,

We've added your request to our wish list.

In the meantime you can edit exported pages in the way you want manually.

Thank you,
Olivia

Hi, We've added your request to our wish list. In the meantime you can edit *exported* pages in the way you want manually. Thank you, Olivia
Stagger Lee
1775 Posts
Stagger Lee posted this 28 September 2015

Thanks.

I dont plan to use HTML themes for now.
.php extension would allow you to have CMS Control in HTML themes.

Thanks. I dont plan to use HTML themes for now. .php extension would allow you to have CMS Control in HTML themes.
TJ Novick
29 Posts
TJ Novick posted this 14 August 2016

Hi,

We've added your request to our wish list.

In the meantime you can edit exported pages in the way you want manually.

Thank you,
Olivia

Can you please tell me how to edit exported pages manually? Thank you

> Hi, > > We've added your request to our wish list. > > In the meantime you can edit *exported* pages in the way you want manually. > > Thank you, > Olivia > Can you please tell me how to edit exported pages manually? Thank you
Support Team
Support Team posted this 15 August 2016

Hi,

You can edit the files extensions after the export. Simply change it from .html to .php.

Sincerely,
Hella

Hi, You can edit the files extensions after the export. Simply change it from `.html` to `.php`. Sincerely, Hella
You must log in or register to leave comments