To use your DataFlex apps in a WordPress site, you must first make a couple of simple modifications.
To modify a DataFlex web app to run under DF4WP:
- From the unzipped DF4WP.zip files you placed on your development machine, unzip the DF4WPLib.zip into its own directory, then from your project workspace, add that as a library: Tools –> Maintain Libraries… –> Add Library… navigate to the directory you extracted DF4WPLib into and select the DF4WPLib.sws file, click “Yes” (or “No”, depending on your pathing preference) then “OK”.
- Modify your WebApp.src to Use cWPWebApp.pkg rather than cWebApp.pkg and change the class of the oWebApp object to cWPWebApp.
- For any view which is going to appear on a WordPress page (whether embedded stand-alone on a page or as part of an embedded web-app), change the Use cWebView statement to Use cWPWebView and change the class of the actual view object to be cWPWebView (for example oMyView is a cWebView would become oMyView is a cWPWebView).
- If you intend to use the WordPress login mechanism rather than the DataFlex framework’s login mechanism (see property pbUseWPLogin below), any look-up list modal dialogs which are going to be used by that view need to be modified to Use cWPWebModalDialog.pkg rather than cWebModalDialog.pkg and the class of the object changed to cWPWebModalDialog.
- If you are using images in your application, you should change any Use statements to refer to cWPWebImage.pkg and/or cWPWebColumnImage.pkg, changing the class of the image objects appropriately.
- Compile your application. Test that it works as normal.
When you have successfully modified your DataFlex Web applications, you are ready to deploy the applications. Find out how…