Internal Custom Page: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
(The midas documentation has moved to https://midas.triumf.ca/docs/)
 
Line 1: Line 1:
<div style="column-count:4;-moz-column-count:4;-webkit-column-count:4">
The midas documentation has moved. See [https://midas.triumf.ca/docs/develop/api/javascript/deprecated/#other-features-of-older-custom-pages Other features of older custom pages] on the Deprecated web features page and [https://midas.triumf.ca/docs/develop/features/monitoring_and_control/custom_pages/ Custom pages: overview] for the new documentation about custom pages stored in the ODB.
* [[Midas_documentation|Midas Documentation]]
* [[Feature_listing|Feature Listing]]
* [[Application_listing|Application Listing]]
* [[Online_Database|Online Database]]
</div>
 
= Links =
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* [[Mhttpd|mhttpd MIDAS web server]]
* [[ODB Page]]
* [[Programs Page]]
* [[Alarms Page]]
* [[MSCB Page]]
* [[History Page]]
* [[Custom Page]]
* [[/Custom ODB tree]]
* [[odbedit]]
</div>
= Purpose =
This page describes how to create an internal [[Custom Page]].
 
= Introduction =
An '''Internal''' custom page is one where the html code is fully stored in the Online Database (ODB), whereas an  [[Custom Page#Introduction|External]] custom page has the html code stored as an external file. All the features described for [[Custom Page|Custom Pages]] should work for internal pages, but may not have been tested. External custom pages are recommended, unless the custom page code is small.
 
= How to create an Internal Custom Page =
An internal custom page (written in HTML) may be imported under a given [[/Custom ODB tree|/Custom]] ODB key. The name of this custom key will appear on the [[Status Page]] as a [[/Custom ODB tree#Custom-Button|custom-button]]
The name of the custom key is chosen by the user, however some characters in the name (i.e. "&","!") have special meaning, and some restrictions apply (see [[/Custom ODB tree#Key names|custom key names]]).
 
By clicking on this custom-button, the contents of this key is interpreted as HTML content. Figure 1 shows an internal custom page which has been imported into the ODB at key <span style="color: purple; font-style:italic;">/Custom/Overview&</span>.
<br>
 
{|  style="text-align: left; width: 100%; background-color: rgb(255, 255, 255);" border="0" cellpadding="2" cellspacing="2"
|+ Click on thumbnails to enlarge
|- 
| [[File:Mhcustom1.gif|thumb|left|Figure 1: Internal Custom Page example]]
| [[File:int_custom_page1.png|thumb|left|Figure 2: Internal custom page imported into key Overview&]]
| [[File:int_custom_page2.png|thumb|left|Figure 3: Contents of key Overview& can be edited]]
|}
 
<div style="clear: both"></div>
<div style="odbedit import export"></div>
The insertion of a new Internal Custom page requires the following steps:
 
*    Create an initial html file using your favorite HTML editor (see [[Features available on custom pages]])
*    Import this file using the [[odbedit]] command <span style="color:saddlebrown; font-style:bold; ">"import" </span>, e.g.
[local:midas:S]/custom>import int_custom.html Overview&
 
 
'''Note:'''
 
* Once the file is imported into ODB, you can ONLY edit it through the web through the [[ODB Page]]. Clicking the Edit link under the ODB key <span style="color: purple; font-style:italic;">/Custom/Overview&</span>  (Figure 2) will open an editing window (Figure 3) which can be used to edit the code. Note that Figure 2 also shows a link to an external webpage at <span style="color: purple; font-style:italic;">Custom functions&</span>.
* The Custom page can also be exported back to a ASCII file using the [[odbedit]] command <span style="color:saddlebrown; font-style:bold; ">"export"</span>, e.g.
[local:midas:Stopped]/>cd Custom/
[local:midas:Stopped]/Custom>export test&
File name: mcustom.html
[local:midas:Stopped]/Custom>
 
 
<div style="clear: both"></div>
[[Category:Custom]]

Latest revision as of 22:00, 30 October 2026

The midas documentation has moved. See Other features of older custom pages on the Deprecated web features page and Custom pages: overview for the new documentation about custom pages stored in the ODB.