I gave a try to TMS webcore to include a couple of custom pages inside wordpress pages.
I installed "Code Snippets" plugin to wordperfect to avoid direct editing
I created two code snippets:
a) One to include the Javascript file loading in the head tag of the produced page like the following:
add_action( 'wp_head', function () { ?>
<script type="text/javascript" src="/root/Project1.js"></script>
<?php } );
b) one to include the javascript running just before the end of the element:
add_action( 'wp_footer', function () {
global $post;
if ($post->ID ==1177) {?>
<script type="text/javascript">
rtl.run();
</script><?php
}
});
I have created a new page in Wordpress with the above ID and I included a custom html element with a
<div id="test"></div>
I created a subdirectory /root inside the wordpress and I changed the .htaccess to not produced a 404 error if a request is done for a resource inside this directory
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/root/.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Now I created an one form with the wizard of TMS WEB FORM and in the form I used a Twebpanel with ElementID the "test" from the above DIV tag, I compiled the project and I put the Project1.js in the /root folder in the wordpress webpage
The wordpress is loading the wordpress's page, before javascripts starts, and after that I get the wordpress's 404 page with the webcore's controls in left upper corner of the page.
Any suggestions? Thank you in advance