Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By qqboy on
did i miss something?
situation 1:
in preprocess function i write:
hide($variables['field_tag']);
but dpm($variables) in tempalte still output
$...['field_tag']['#printed'] as TRUE,
on /node/xxx
situation 2:
in preprocess function i write:
$variables['field_tag'][0]['taxonomy_term']->name = 'michaeljackson';
but dpm($variables) in tempalte still output
$...['field_tag'][1]['taxonomy_term']->name as before
in /node/xxx
overall in template.php code is like
hide($variables['field_tag']);
$variables['field_tag'][0]['taxonomy_term']->name = 'michaeljackson';
dpm($variables);
did i miss something.
hope some one can help us make it clear
ps i cleared cache.
thank u very much in advance.
thanks.
Comments
I have a strong feeling that
I have a strong feeling that you didn't pass $variable by reference.
What's new and changing in PHP 8
sorry but i have to tell u
sorry but i have to tell u
wrong
i do passed & infront it.
if not, then no matter what i do there will be no changes.
the strange thing is
i need to print something extra to activate changes
or log in and out to activate it.
is it normal or i miss something?
thanks.
https://www.drupal.org/project/image_captcha_indicator
https://www.drupal.org/project/ext_js
You haven't shown us enough
You haven't shown us enough code to be able to help.