PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Re:jdoc:include (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:jdoc:include


#3733
anders_123 (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
jdoc:include 1 Month, 2 Weeks ago Karma: 0  
I add this code to my article:

<?php echo jdoc:include type='message' style='xhtml' ;?>

, but nothing shows up.

<?php echo test;?> works fine and shows 'test', so the basics works.

Is it not possible to make jdoc:include through directphp?
 
  The administrator has disabled public write access.

#3734
kksou (Admin)
Admin
Posts: 1240
graph
User Online Now Click here to see the profile of this user
Re:jdoc:include 1 Month, 2 Weeks ago Karma: 20  
Hi,

Please take note of PHP scoping.

Although DirectPHP is run inside an article, the statements within DirectPHP is run through a standard PHP eval() - in its own space. What this means that it has no access to the Joomla space. If you need to access anything from within eval(), it has to be available via global variables. e.g. you can easily access $_GET, $_SERVER, etc. from within eval().

Regards,
/kksou
 
  The administrator has disabled public write access.

#3735
anders_123 (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Re:jdoc:include 1 Month, 2 Weeks ago Karma: 0  
Thanks. Just for your information I solved my little problem by adding the following to index.php instead:

<?php if( JRequest::getVar( 'id' ) == '24' ): ?>
<jdoc:include type="message" style="xhtml" />
<?php endif; ?>

(24=articleID)

Regards Anders
 
  The administrator has disabled public write access.



Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2009. kksou.com. All Rights Reserved