Tag Archives: Basics

OpenSencillo add subpages

You can add your first subpage with custom URL.

  1. Find file yourcode.php.
  2. Open yourcode.php to edit your new webpage.
  3. Add code:
    <?php
      $seo=new headerSeo; //add minimal seo and create opening HTML tag
      $seo->encode(); //add page encoding to UTF-8
      $seo->robots(); //add support for bots control
      echo $seo->save(); //generate meta tags
    ?>
    <body>
    <?php
      switch(PAGE)
      {
        //create new subpage by case
        case 'my-first-subpage':
        case '/my-first-subpage':
          echo 'HELLO SUBPAGE';
        break;
        //create homepage / landing page
        case '':
        case '/':
          echo 'HELLO WORLD';
        break;
        //create custom 404 page
        default:
          echo 'MY 404 PAGE';
      }
    ?>
    </body>
    </html>
    
  4. Save yourcode.php and open your example.com first page where is installed OpenSencillo.
  5. Check example.com/my-first-subpage new subpage with pretty URL.
Facebooktwitterredditpinterestlinkedinmail

OpenSencillo hello world webpage

After installation you can write your first webpage.

  1. Find file yourcode.php.
  2. Open yourcode.php to edit your new webpage.
  3. Add code:
    <?php
      $seo=new headerSeo; //add minimal seo and add opening HTML tag
      $seo->encode(); //add page encoding to UTF-8
      $seo->robots(); //add support for bots control
      echo $seo->save(); //generate meta tags
    ?>
    
    <body>
      HELLO WORLD
    </body>
    </html>
    
  4. Save yourcode.php and open your example.com first page where is installed OpenSencillo.
Facebooktwitterredditpinterestlinkedinmail