about_basicsNameTx

Let's have quick glance at how a simple site is created.

Define a site structure

Let's assume you have already set-up and configured your webserver in the basic configuration, see setup. A single file is used to define the entire site structure - the menu.ini located in the /include folder.

menu = {
         index = 1 // state this page is an index page
         id = index // page unique id
         page = html // name of the page template (assumes .html extension)
         container = index // name of the governing container (assumes .php7 extension)
       }

The above is everything you need to create a working website from a programming standpoint, in this case an one-page website, using a generic html.html file as a global template and index.php7 as a container script.

There are dozens of configuration options available to enhance and streamline the menu configuration to create default values and dependencies, but this will do for now.

Create an overall html template

The page parameter in menu.ini defines a name of a governing html template for a given page. In most of the cases, it will be a html.html file located in /include/html folder. In the most basic way, it will look like this:

<html>
 <head>
  ...
 </head>
 <body>
  <main>
   [main]
   </main>
 </body>
</html>

Note the [main] pseudo-code. This is one of the main building blocks of the entire framework and it's called a placement or a placement location. In this example, there is only one placement inside the main element, but you can have an endless number of placement locations for various purposes, allowing you to place any content to any location within your template structure.


Configure page container

A container is a file located in the /include folder and it defines the functionality of any given page. A container can be as simple as a single line or as complex as a huge code with a complex functionality.

It is indeed possible to nest containers to keep the markup simple and use shorthands

<?
 $this->StaticHTML(["html"=>"intro","placement"=>"main"]);
 $this->index_features(); //include the functionality defined in the container "index_features" here
?>
In the above example, we have included two elements in the container. A static html element intro.html placed into the [main] display location and a shorthand calling the index_features.php7 container with extra functionality

Use pre-made functions or write your own

In the aforementioned example, we called the index_features.php7 container using a shorthand function. The container then includes simple plugin which parses a .txt file, creates a list of items based on that file and is placed in to the [main] display location. Again, it is possible to endlessly configure / enhance each container or plugin, write your own etc.

<?
 $this->rotate_file("features.ini");
 //features.ini ===============================================
 file=index_features.txt
 html=index_features
 items=index_features_items
 placement = main
 //features.ini ===============================================
?>