When I finished the previous exercise that simulated a list of forms in an organization, I had the “problem” of how to publish this list of forms in a CMS content portal and although on other occasions I have done this with the Joomla CMS, in this case I set out to do it with WordPress which is the most widespread and the one I like the most for my blog.
I have reviewed articles on the PHPRunner forum and I see that this topic has been treated, but a long time ago, with very earlier versions of PHPRunner, so it seemed good to do the exercise.
Objectives I am looking for in the exercise:
- Integrate the data and if possible the presentation of the same we do with PHPRunner.
- Use, if possible, a product that does not carry an additional cost
- Make it functional, but at the same time simple for PHPRunner developers.
- That the presentation can be made in Spanish, so that the solution is open to more languages than English.
- I am interested in the publication part and not the maintenance management of the contents because I want to have that functionality always in PHPRunner.
Following the previously published articles, I started by testing the integration by IFRAME and thus perform the following tests.
I have used the “IFRAME” plugin that we would have this type of presentation.
And this other plugin “POPUP WITH FANCYBOX”, which opens a window and shows the application .
I don't like any of the 2 solutions and they seem impractical.
I remembered that we can program that through a parameter in the execution URL we can tell PHPRunner to delete menus, headers and that is what I include in this article in case you need to use it.
In the event "after application initialized" include the code:
if(isset($_GET['iframe']) AND $_GET['iframe'] !== '' )
{ $_SESSION['iframe'] = $_GET['iframe']; }
With this, if we run the application with http: // localhost / forms? Iframe = y, a session variable "iframe" will be created that will have a value of "y".
I have created a file “use_iframe.php” in the “ICM” directory with the code to deactivate the information blocks we want.
if($_SESSION['iframe']=='y') {
$xt->assign("left_block", false); // Turn off Menú left
$xt->assign("supertop_block", false); // Turn off Menú top
}
In all the tables and presentations where we want to remove these blocks we will have to include this code in the “Before display” event:
include "ICM/use_iframe.php";
How to know which block to deactivate or not generate code?
In the "Editor" option, press the "HTML Mode" button and we will have an image of this type:
There we can see the blocks that have the design that we have chosen.
Even with these possibilities, the solution was not to my liking.
In integrations of this type with Joomla I really liked a “JOODATABASE” product that allows us to integrate external tables and excellent data presentations can be made.
To see if there was a similar product in WordPress I started consulting this publication https://wpleaders.com/best-wordpress-table-plugins/ and between one navigation and another, I found WP DATA ACCESS, which more or less does what I was searching and publishing data from external tables in WP tables through SHORTCODE.
In most of these products, the FREE versions are only in English. What I was looking for was that the part of publication on the portal could be put in the language that is needed and that is why I have translated that part into Spanish and in the same way it can be done for any language.
This image shows the result of publishing some of the Forms sample data.
Thus, this solution would allow to integrate the "list" of the forms and from there to access the PHPRunner development for the input of the form data and other part of the process.
In this way you can do, with what we take advantage of the data but not the presentation of them, of the development made in PHPRunner.
To make the links in the presentation you have to encode a field as if it were an html in the MySQL database view. An example of this is this view:
SELECT
`idform_steps`,
`Name`,
`Order`,
concat(' <a href="http://localhost/forms/',Url,'" target="_blank">',URL,'</a>') Url,
`Instructions`
FROM forms.form_steps;
I believe that the best solution for the integration of PHPRunner projects in WordPress is to produce the list with the WP DATA ACCESS plugin and from there, open a new window with the PHPRunner application.
That new window can take the whole context of the application (Menus, headers, etc.) or we can “clean” the presentation to leave it exclusively in the context of the WordPress portal connection.
[size="4"][/size]
In my blog https://fhumanes.com/blog/otros-ejemples/integrar-en-wordpress/ I leave in attached files the WordPress plugin (modified). The literals to be translated (for the presentation of the data) are in the javascript, specifically in “dataTables.responsive.min.js” and “jquery.dataTables.min.js”. The method is to find the chain to replace and change it.
I hope you find it useful and if you have any questions or problems, please tell me through my email [email="fernandohumanes@gmail.com"]fernandohumanes@gmail.com[/email].