1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Update site code with dynamic webpage creation

Discussion in 'HTML & Website Design' started by Makis, Jun 10, 2022.

  1. #1
    I will simplify the problem.

    The basic html template of the site is like:
    Header Section
    Content 1 Section
    Content 2 Section
    Content 3 Section
    Footer

    If page 1 is called then show Header, Content 1, Footer
    If page 2 is called then show Header, Content 2, Footer
    If page 3 is called then show Header, Content 2, Content 3, Footer

    One idea is to have header.html, content1.html, content2.html, content3.html , footer.html and
    create page1.html, page2.html, page3.html

    How could you update the view of your site and how do you save when to show what?

    Should I use a backend database?

    Should I create objects for Header, Content, Footer?

    Or I load the site as a single page template and update only some sections?
     
    Makis, Jun 10, 2022 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #2
    A backend database isn't essential if your content changes infrequently and you're comfortable working with HTML files and uploading them.

    You do, however, need to decide what's building your site. The easiest is PHP but if you want to learn a whole platform there are other options.

    HTML pages are "static" and can't do anything like import other HTML pages in the way you've described.

    require 'header.html';
    require 'content2.html';
    require 'footer.html'
    PHP:
     
    sarahk, Jun 10, 2022 IP
  3. Makis

    Makis Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    Last edited by a moderator: Jun 11, 2022
    Makis, Jun 10, 2022 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #4
    cool, check what is able to be indexed though.

    What to learn depends on your goals and the time/effort you want to spend. Tell us a bit more about yourself - are you just curious, or trying to promote your business, looking to be a hobbyist developer, or looking to launch yourself into a new career?
     
    sarahk, Jun 10, 2022 IP
  5. Makis

    Makis Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    I just want to improve my skills on web development.
     
    Makis, Jun 10, 2022 IP
  6. Makis

    Makis Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #6
    A javascript solution to include HTML files

    https://www.w3schools.com/howto/howto_html_include.asp
     
    Makis, Jun 10, 2022 IP