Hello world
New php file
- First make a php file. To do so open a text editor (i.e. Notepad++).
- Copy the code below.
~~~~
Hello world ~~~~- Save the file as php. (in Notepad++ go File->Save as... in the File name textbox enter the name for the file and add .php (i.e. template.php).
- Save the file to the myportal installation directory in the subdirectory template.
Replacing the html code with a php code
The span tag with the Hello world entry is going to be put in a template file to be called from the template.php file we created before.
- Again make a php file. To do so open a text editor (i.e. Notepad++).
- Copy the code below.
- Save the file as php. (in Notepad++ go File->Save as... in the File name textbox enter the name for the file starting with tpl_ and add the extention .php (i.e. tpl_greetings.php).
- Save the file to the myportal installation directory in the subdirectory template.
In the template.php file replace the line that was put in the greetings.php with the following php tag:
~~~~~~~~~~~~~~~ =$greeting;?> ~~~~~~~~~~~~~~~
Adding content in Myportal
Log into the Myportal control panel and here we have global setings for the web site. On top are the main modules like settings. Clicking on it will show the settings menu on the left.
main settings
First is the option for the default language in the language section. Next is the Web site section.Here we can set the web site session name (most likely the name of the company) in the Web site session name input field. The Start page input field is for naming the first page or index of the web site. We can also enter the email and the name of the autor. Lets leave the remaining settings for now.
display settings
Now in display settings we select which file will be shown ona all of the pages on the web site and which will be shown only in a specific display. For this example we can go for general functions because we have just one page and we don't need other subpages to be displayed.
- Lets add the general function by clicking on the php icon on the end of the general funtion green line on the right.
- Now we have several options to choose from the drop down menu path. Select the article as it is the simpliest one. Next we have to choose the function, lets go for article.
- More options to select. Function output is the array of results that was generated with the previous selection. It can be one or two dimensional. Name it as you wish.
- In the template drop-down select the template file with the content you would like to be shown. In this case is the greetings.php with the hello world statement.
- Template output is the variable name used in the template.php file so Myportal will know where to make the output.
This is it. If you go to the first page of the web site there should be the Hello world greeting.