This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
en:startpage [2016/05/18 07:59] wvdkuil [Add new / your own components] |
en:startpage [2016/05/18 08:02] (current) wvdkuil [Add new / your own components] |
||
---|---|---|---|
Line 95: | Line 95: | ||
So lets go step by step through the development process: | So lets go step by step through the development process: | ||
- Copy the **_my_scripts/my_NewPage.php** script and give it a new name: **my_component_1.php** | - Copy the **_my_scripts/my_NewPage.php** script and give it a new name: **my_component_1.php** | ||
- | - To test the component, place it in your menu by adding it to the wsMenuData.xml file\\ <code><item nr = "1000" hide = "yes" | + | - To test the component, place it in your menu by adding it to the wsMenuData.xml file <code><item nr = "1000" hide = "yes" |
caption = "test component" | caption = "test component" | ||
link = "_my_scripts/my_component_1.php" | link = "_my_scripts/my_component_1.php" | ||
/></code>With **hide = "yes"** in a menu entry you can run the script but it will not be shown in the menu for a normal visitor. | /></code>With **hide = "yes"** in a menu entry you can run the script but it will not be shown in the menu for a normal visitor. | ||
- Test your script/component www.uwwebsite.xyz/weather??/?p=1000 using the number as typed in the previous step | - Test your script/component www.uwwebsite.xyz/weather??/?p=1000 using the number as typed in the previous step | ||
- | - When you are happy with the functioning of your new script, it is time to add the new script to your startpage. | + | - When you are happy with the functioning of your new script, it is time to add the new script to your startpage.\\ Add the following code <code> if ($dashboard[$iDash] == 'my_component_1') { |
- | - Add the following code <code> if ($dashboard[$iDash] == 'my_component_1') { | + | |
$script = '_my_scripts/my_component_1.php'; | $script = '_my_scripts/my_component_1.php'; | ||
if (is_file($script) ) | if (is_file($script) ) | ||
Line 108: | Line 107: | ||
continue; | continue; | ||
} | } | ||
- | </code>to the bottom of wsStartPage.php **before** the last **}**.\\ It should look like this <code> if ($dashboard[$iDash] == 'my_component_1') { | + | </code>to the bottom of wsStartPage.php **before** the last **}**. It should look like this <code> if ($dashboard[$iDash] == 'my_component_1') { |
$script = '_my_scripts/my_component_1.php'; | $script = '_my_scripts/my_component_1.php'; | ||
if (is_file($script) ) | if (is_file($script) ) | ||
Line 124: | Line 123: | ||
</code>So we added our new compent as the last one on the startpage. | </code>So we added our new compent as the last one on the startpage. | ||
- | All done, succes with developing your own components. If they are usefull to others also, please mention them on the different forums also. | + | All done, succes with developing your own components. If they are usefull to others also, please mention them on the different forums. |