new feature non-required fields (temp 1.2)

Jaap Borra's picture
Jaap Borra
Sun, 11/08/2015 - 17:17
#1
new feature non-required fields (temp 1.2)

If I apply a template that uses the drupal-field "name" on the corresponding content-type where the field "name" has no value, I receive an error.

Please ignore fields with empty values.

phuonght's picture
phuonght
Mon, 11/09/2015 - 03:06

Please try to edit/ change file sites/all/modules/custom/md_awecontent/templates/frontend/awe-drupal-field.tpl.php to

<?php

$field_instances = field_info_instance('node', $settings['fieldName'], $settings['nodeType']);

$display = field_get_display($field_instances, 'full', $node);

$field_render = field_view_field('node', $node, $settings['fieldName'], $display);

?>

<?php if (count($field_render) > 0): ?>

<?php print render($field_render); ?>

<?php else: ?>

<div></div>

<?php endif; ?>

Jaap Borra's picture
Jaap Borra
Fri, 11/13/2015 - 05:20

This code was not in 

custom/md_awecontent/templates/frontend/awe-drupal-field.tpl.php in the last update send to me by Cindy!

Can you please correct thid?

Thanks,

Jaap

cindy's picture
cindy
Fri, 11/13/2015 - 22:01

Hi,

Please help us to add the code in file awe-drupal-field.tpl.php


Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.