XML-based pages are more controlled than html-based pages, and are edited in a form-based environment. Xml is useful for creating different types of registers in the Page Structure without using a database. These can be lists with co-workers, news, articles etc.
Xml-based pages are also used when the page will be shown in other types of applications, e.g. Macromedia® Flash.
This page introduces you to creating and using xml-based pages on a web site, and how you get Flash® to communicate with Consolo.
When an editor chooses to edit an xml page, the xml file is retrieved from the server an Consolo anylizes it to build a form. Here is a short example of what an xml page can look like:
The xml page looks like this when it is edited in Consolo:

As you can see there are many types of form elements that can be used. It is always a good idea to start a page with a hidden value (e.g. “PAGETYPE”) that describes what type of data the page contains. This is necessary when you have many types of xml pages on the web site.
Information on how to write the xml-pages can be found in the Appendix: Xml-defined forms »
Exactly how you use the xml-data on the web site is up to you. Open and analyze the xml file with the help of e.g. MSXML2.DOMDocument (ASP), the support functions in /consolo/inc_xml.php (PHP) or Actionscripts Xml-class (Macromedia® Flash).
Since the editor will be able to browse through the xml files and view them, you should create a page that can recieve and view all types of xml files that are being used on the web site. This is called an xml-gateway.
Please download any of these example-scripts. They are good to start out from when you design your own page:
Decompress (un-zip) the script and upload it to the Consolo folder.
This general viewing page should be set under Gateway for xml files in the web site’s configuration, e.g. “consolo/viewXml.asp?file= ”.When an editor clicks an xml file in the Page Structure, the page set in the Gateway for xml files will be called. Consolo adds the http root, the given xml gateway and the chosen file in Consolo’s pageKey format , into a URL. This can look like this:
http://www.mycompany.com/consolo/viewXml.asp?file=myfolder/mypage.xml
If there is no xml gateway, the raw data will be shown in the web browser.
For more information and help, see the examples Create a News Archive and Create Web Sites in Flash .
Besides what was earlier mentioned about Gateway for xml files there is one other setting that needs to be made for web sites entirely created in Flash®.
Normally, the Page Structure in Consolo follows the way a user surfs in the web browser. The page shown in the browser is automatically highlighted in the Page Structure. If you have a web site entirely made in Flash®, Consolo won’t automatically know what page is just now being shown. This results in that the “Surf-Edit-Publish” workflow will not function.
To fix this problem, insert the code below into the page where the Flash file lies:
Consolo reads the value cnsPageKey continuously. The only thing you have to do now in the Flash® application is to send the PageKey value (read about Consolo’s pageKey format ) to the javascript-function setCnsPageKey every time the user changes a page. For instance, like this:
or
For more information and help, see the example Create Web Sites in Flash »