Skip to main content
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
added 303 characters in body
Source Link
echo
  • 1.5k
  • 14
  • 21

Case: I am using conditional fields module to hide some dependent fields based on the value of its dependee field. I have created a custom node--content-type.tpl.php template for my content type.

Field1

Field2

Here, Field2 is dependent on the value of Field1. Suppose in this case, Field2 is rendered only if Field1 has value 'jobs'. Otherwise, it is hidden from both node edit form and node page.

When using seven theme and its display(default or teaser) to view node, if the Field2 is hidden or the dependency was not triggered the Field2 is not rendered on the node page, which is correct.

But, when using my custom template, I am not been able to prevent the rendering of Field2 on my node. It is shown with its default value on the node.

Please help.

template code:

<?php if(isset($content['field_job_type'][0]['#markup'])):?>
              <li>
                <p class=" no-margin "><strong>Job Type:</strong> <?php print $content['field_job_type'][0]['#markup'];?></p>
              </li>
            <?php endif;?>

Case: I am using conditional fields module to hide some dependent fields based on the value of its dependee field. I have created a custom node--content-type.tpl.php template for my content type.

Field1

Field2

Here, Field2 is dependent on the value of Field1. Suppose in this case, Field2 is rendered only if Field1 has value 'jobs'. Otherwise, it is hidden from both node edit form and node page.

When using seven theme and its display(default or teaser) to view node, if the Field2 is hidden or the dependency was not triggered the Field2 is not rendered on the node page, which is correct.

But, when using my custom template, I am not been able to prevent the rendering of Field2 on my node. It is shown with its default value on the node.

Please help.

Case: I am using conditional fields module to hide some dependent fields based on the value of its dependee field. I have created a custom node--content-type.tpl.php template for my content type.

Field1

Field2

Here, Field2 is dependent on the value of Field1. Suppose in this case, Field2 is rendered only if Field1 has value 'jobs'. Otherwise, it is hidden from both node edit form and node page.

When using seven theme and its display(default or teaser) to view node, if the Field2 is hidden or the dependency was not triggered the Field2 is not rendered on the node page, which is correct.

But, when using my custom template, I am not been able to prevent the rendering of Field2 on my node. It is shown with its default value on the node.

Please help.

template code:

<?php if(isset($content['field_job_type'][0]['#markup'])):?>
              <li>
                <p class=" no-margin "><strong>Job Type:</strong> <?php print $content['field_job_type'][0]['#markup'];?></p>
              </li>
            <?php endif;?>
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
Source Link
echo
  • 1.5k
  • 14
  • 21
Loading