Re:jdoc:include (1 viewing) (1) Guest
Favoured: 0
|
|
|
TOPIC: Re:jdoc:include
|
|
|
|
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.
|
kksou (Admin)
Admin
Posts: 1240
|
|
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.
|
|
|
|
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.
|
|
|
|
|