Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8805647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:55:15+00:00 2026-06-14T01:55:15+00:00

New to web programming. I was wondering if it was common to use includes

  • 0

New to web programming. I was wondering if it was common to use includes to template a page. For example you have header, nav, and footer code all in separate files, and then you include them for a specific page with the content varying. How is this different from templating languages or templating engines like Smarty I’ve been coming across in my research?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:55:17+00:00Added an answer on June 14, 2026 at 1:55 am

    IMHO I like rather having a single layout view that contains anything that does not move across pages.

    <!DOCTYPE HTML>
    <html>
        <head>
            <meta></meta>
            <styles></styles>
        </head>
        <body>
            <nav></nav>
            <header></header>
            <section class="rightColumn"></section>
            <section class="mainContainer">
                 <?php include('your/awesome/view.php') ?>
            </section>
            <footer></footer>
            <script></script>
        </body>
    </html>                
    

    You may have a look at TWIG template engine.
    It makes it very easy

    layout.html.twig

    <!DOCTYPE HTML>
    <html>
        <head>
            <meta name="description" content="{% block metaDesc %}{% endblock %}"></meta>
            <style></style>
            {% block appendStyle %}{% endblock %}
        </head>
        <body id="{% block bodyId %}{% endblock %}">
            <nav></nav>
            <header></header>
            <ul class="breadcrumb">
                {% block breadcrumb %}{% endblock %}
            </ul>
            <section class="rightColumn"></section>
            <section class="mainContainer">
                {% block body %}{% endblock %}
            </section>
            <footer></footer>
            <script></script>
            {% block appendScript %}{% endblock %}
        </body>
    </html>
    

    page.html.twig

    {% extends '::layout.html.twig' %}
    
    {% block metaDesc %}Hey, that is my description !{% endblock %}
    
    {% block appendStyle %}
        <link rel="stylesheet" href="path/to/specific.css">
    {% endblock %}
    
    {% block bodyId %}index{% endblock %}
    
    {% block breadcrumb %}
        <li><a href="">Homepage</a></li>
    {% endblock %}
    
    {% block body %}
        <h1>Awesome Website</h1>
        <h3>Latest news..</h3>
        <article></article>
    {% endblock %}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to web programming and Visual Web Developer. I have made a
I am new to web programming and my first draft of a web page
I am new to web programming...I have been asked to create a simple Internet
I'm new to Django and Web programming in general. Have googled but could not
I am relatively new to ASP.NET programming, and web programming in general. We have
I'm new to web programming, but I had an idea I could use as
Hi I am new to web programming. I want to create a template sort
I am a college student slightly new to web programming and lately I have
In undertaking web site design/programming projects, I was wondering if it is common for
I'm relatively new to web programming. New to Javascript, PHP, Ajax, etc. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.