Hi,
I've added two custom fields to the Portfolio content type (as displayed in the image below)
In order to view these fields' values on the portfolio page and grid view, I added two lines of code to the file sites/all/themes/md_boom_multi/template/node--portfolio.tpl.php (between the existing fields):
When viewing the portfolio page, the values are unfortunately not rendered correctly ; and "select all" reveals that the value (in this case the number 26 is redered as "<div class="field-label">Age: </div> 26" instead of just the value 26 (which is the case for the pre-defined fields ; they are rendered without the superfluous <div class="field-label">...</div>).
What do I need to do in orde to correctly render this value? I'm sure I just have to add the new fields somewhere to a list of fields that are already recognized by Boom, but I can't seem to find out where...
Could you please point me in the right direction? Any kind of assistance would be greatly appreciated!
Thanks!
-Pieter
Hi,
<?php print render($content['field_name']); ?> can not be wrapped by tag <p></p>. That why there will come the error when printing.
You can use only: <?php print render($content['field_name']); ?>
and in folder "template" you need to create file field--field-name.tpl.php (you can look for more at: https://www.drupal.org/node/1089656).
In that file, you can print html as you want.