Hello,

I have a display problem with check_plain() in node-exemple.tpl.php.

<?php print check_plain($info['field_alesage']['widget']['label'] . ' × ' . $info['field_course']['widget']['label']); ?>

This code returns me a null result because of "×". I can not understand why especially since this same code works in one of my blocks.

Thank you for your help!

Comments

dnewkerk’s picture

Try running check_plain on each individual part, then concatenate those results together.

pobster’s picture

Why do you think it's the 'x' that's causing the problem? That seems highly unlikely to me, 'x' is just text so that's irrelevant??

Have you checked that $info even contains anything? The template file doesn't have the same stuff available to it that a block does.

Pobster

Clément’s picture

Thank you for your help.

If I replace "x" by "+" it works.
Result: Bore + Stroke
If I deliver "x" nothing appears.

For the first solution cons running provided to replace the "x" by "&times;"

I'm going to put two check_plain() even if I does not understand why it works in block.tpl.php and not in node.tpl.php...

Greetings
Clément