====== webv4 Customization ====== ==== CSS ==== [[https://www.w3schools.com/css/default.asp|Cascading Style Sheets]] can customize the look and layout of your site. In particular, ''webv4/root/css/custom.css'' can hold locally-defined rules. If it exists, this file is loaded into the page *after* the stock style sheets, and can override previously declared rules or add new ones. You can use this file to alter the background colour of your site, include a background image, change the appearance of links, change the layout, etc. You should *not* modify any of the stock ''.css'' files unless you have a good reason for doing so. Put your changes in ''webv4/root/css/custom.css'' instead. Note that ''webv4/root/css/custom.css'' does not exist by default. If you want to use it, you must create it. This web interface uses [[http://getbootstrap.com/|Bootstrap 3.3.5]]. It should be possible to use any compatible style sheet. Some work probably needs to be done to make these easier to swap out. ==== XJS and SSJS ==== This web UI makes extensive use of [[http://wiki.synchro.net/server:web#xjs_files|XJS Files]] and, to a lesser extent, SSJS files. XJS files are HTML documents with snippets of Server-Side JavaScript embedded within them, inside '''' tags; apart from the '''' blocks, they are the same as any HTML document. SSJS files are Server-Side JavaScript modules. They must contain only valid javascript, which will be executed on the server. They can send strings to the client using the ''write()'' or ''writeln()'' methods. If they don't send anything, the client will receive an empty page. If you're sending a lot of output to the client with only a few dynamic components, it's best to use XJS. If you're mostly performing scripted tasks and sending little static output to the client, SSJS may be more appropriate. See the [[http://wiki.synchro.net/server:web#javascript_objects|the webserver documentation]] for information about special values and methods available to scripts running on the web server. (Note: The web server generally handles creating and sending HTTP headers. Use the ''http_reply'' object sparingly and with caution.) You may notice several ''.xjs.ssjs'' files in various locations. These are compiled XJS files, and are generated as needed when somebody requests an XJS file from the server. You can ignore these files, and you should not waste time editing them as they are frequently overwritten. Modifying the main layout script, ''webv4/root/index.xjs'' is strongly discouraged. In general modifying any of the *included* files within the ''webv4/root/'' directory structure is not recommended. You can of course add as many files and subdirectories within that structure as you want. ==== Components ==== === Header and Footer === The **header** and **footer** "components" can be used to insert custom content into every (managed) page on your site. If present, these components are loaded by the main layout script every time a page is viewed. You can use these components to execute server-side javascript, client-side javascript (in a ''