By Keizer on
I have two Blocks with PHP code to build up context sensitive menus from the taxonomy. They were without problems functional under Drupa5. I enabled them in my Drupal 6 installation, but they displaz only the PHP text. Is there any parameter in Drupal 6 that I have to change.
(Obviously the content of the Blocks is checked as PHP code..)
thanks for help
Comments
In Drupal 6 there is a
In Drupal 6 there is a separate "PHP filter" module which must be enabled in admin/build/modules. I think it isn't enabled by default.
...it still shows the code
Thanks! I enabled the HTML Filter module, but the code is still not executed, but only displayed. Any parameters to be set?
Check the
Check the admin/settings/filters page, "configure" the "PHP code" input format, and make sure that only the "PHP evaluator" filter is selected and no other filter.
I am done! Thank you!!!!!!!
I am done! Thank you!!!!!!!
PHP in BLock still not working
<?php if ($title): ?><h1 class="title"><?php print $title; ?></h1><?php endif; ?>That is the code I have in my block. I have followed the directions here and at http://drupal.org/node/226102
I am at my wits end on why this will not work and any help will be appreciated.
"Never Attribute to Malice, That Which is Easily Explained by Stupidity."
Return?
I think you have to return code in blocks, not print it. I might be wrong on that, though... I don't write code in blocks much.
Michelle
--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.
I do not believe that true
I would not think that true in that the other post I linked to is using print and echo and they got it to work. But thanks and I will try that.
Theresa
"Never Attribute to Malice, That Which is Easily Explained by Stupidity."
Update
Ok I am able to get php print statements to work, example:
<?php print "hello world" ?>But this does not work:
<h1><?php print $title ?></h1>It only returns an empty h1 tag but if I hard code this:
<?php if ($title): ?><h1 class="title"><?php print $title; ?></h1><?php endif; ?>into my page.tpl.php I get the value for $title.
So now my question is why does it not pick up the variable like it does hard coded?
UPDATE: I have moved this into a new topic here.
Theresa
"Never Attribute to Malice, That Which is Easily Explained by Stupidity."