[opencms-dev] AW: [opencms-dev] Export question (stylesheet, images, dynamic

Thomas März thomasmaerz at gmx.de
Tue Jul 22 12:42:01 CEST 2003


Hello Bjoern,

>>Create a new "page" with the extension ".php", add a property
>>e. g. "php_code=/my/php/test.php" and include the code by your template
>>by reading the property, so you can use different code for each page.
>
>>Take a look at http://62.245.145.118/de/ ; it combines PHP and OpenCms,
>>e. g. the forum template is done by OpenCms resp. all templates, and
>>they use sometimes also PHP-content.

the site moved to http://mwhosting.de/de/

> First what I will do know, is to get running the PHP scripts, I'm
> ignoring the navigation problem at this time...
>
> I think I've done what you have advised. I've created a new template
> in my frametemplate named "myfirstphpscript". There I have included my
> php code (it's just a phpinfo() and an echo for testing). In my
> index.php file (thats the file where the script should be included)
> I've specified an ELEMENTDEF (name = phpscript) which calls the
> TEMPLATE "myfirstphpscript" by TEMPLATESELECTOR. This element I
> include via "element name = phpscript" above.

I think you are mixing the things wrong. I don't know if you can use
<ELEMENTDEF/> in your index.php. If you want to use multiple bodies
search the mailing list.

>> add a property e. g. "php_code=/my/php/test.php" and include the
>> code by your template
>>by reading the property

I am using JSP-code for this:

String php_folder = cms.property("php_folder", "search", "/" + locale + "/php/" );
String php_code = cms.property("php_code", "search");
cms.include(php_folder + php_code);

And now e. g. the code in /my/php/test.php is included; the JSP-code is
put in the JSP-template and now I create a new page new.php with the
properties "php_code=new.inc.php" and "php_folder=/my/php/", do the
export to a htdocs folder of apache and view the page.

It also should be possible to write "<?php phpinfo(); ?>" into the
content of a page using the sourcecode-editor, but this didn't work for
me, because after the export everything between <? ?> disappeared.

Best Regards,
Thomas Maerz




More information about the opencms-dev mailing list