
PositiveMedia
Novice
Dec 19, 2008, 7:49 AM
Post #1 of 7
(4042 views)
Shortcut
|
|
PHP INCLUDES / Retaining Include Code in Published Articles
|
Can't Post
|
|
Hello ! NEW EDIT - SEE BOTTOM POST FOR SOLUTION ! How do I retain PHP Include code in published AM2 Articles? (that do not execute when the Article is published, but execute when the publised Article page is viewed/called) I have a Navigation Menu and text/graphics Snippets that change frequently on our site. In our static, non AM2 pages, the PHP Include is executed when someone views/calls each page (SSI). I have read several posts on how to insert PHP Includes into Templates, but it seems they all execute the PHP Include upon publishing the Article. I need a PHP Include that stays "in-tact" when an Article is publised so that our Navigation Menu and Snippets are executed when each page is viewed/called. We do not use Authors on our site (internal staff updates), so we are not worried about the security of allowing Authors to post code. Is there a way to include a block of code in the Article Templates so that we can accomplish this? I have tried the following: 1) Set the "Dynamic SSI Parsing" to "Server Resolved - supports SSIs and server side code" and set "Temporary File Extension" to "PHP". 2) Added a new Field in my Article Database named "include" (textfield). 3) Added a "TemplateIf" statement in the Article Template to call the "include" if not blank. TEST: Here is the code I used in the Article Template: <!-- templateIf: $article.include$ ne "" --> $article.include$ <!-- /templateIf --> RESULTS: Publishing the Article disables the PHP Include. " Warning: include() [function.include]: URL file-access is disabled... " I have tried using both a "textfield" and a "text box", both did not work. I even tried to use a PHP Include that called another PHP Include to see if the code would be inserted... but that got stripped too! Any help would be greatly appreciated... Thanks, Greg S. positivemedia.com
(This post was edited by PositiveMedia on Mar 31, 2009, 8:15 AM)
|