Skip to main content
deleted 469 characters in body
Source Link
mix
  • 61
  • 7

I have a content type with a text field that i want to render trimmed and full in the same node.

I've set my field to "trimmed" and rendered it in my node.tpl.php using
<?php print render($content['field_image_desc']); ?>

Now i need to render the same field but not trimmed (to display it in an overlay div).

Thanks for helping...

[edit]

i answer myself:

inside node.tpl.php, this is rendering a trimmed version of my field

<?php 
     print render(field_view_field('node', $node, 'field_myfieldname', array(
        'label'=>'hidden', 
        'type' => 'text_summary_or_trimmed', 
        'settings'=>array('trim_length' => 30),
    )));
?>

and then i render my 'default' format field like always

<?php print render($content['field_image_desc']); ?>

I have a content type with a text field that i want to render trimmed and full in the same node.

I've set my field to "trimmed" and rendered it in my node.tpl.php using
<?php print render($content['field_image_desc']); ?>

Now i need to render the same field but not trimmed (to display it in an overlay div).

Thanks for helping...

[edit]

i answer myself:

inside node.tpl.php, this is rendering a trimmed version of my field

<?php 
     print render(field_view_field('node', $node, 'field_myfieldname', array(
        'label'=>'hidden', 
        'type' => 'text_summary_or_trimmed', 
        'settings'=>array('trim_length' => 30),
    )));
?>

and then i render my 'default' format field like always

<?php print render($content['field_image_desc']); ?>

I have a content type with a text field that i want to render trimmed and full in the same node.

I've set my field to "trimmed" and rendered it in my node.tpl.php using
<?php print render($content['field_image_desc']); ?>

Now i need to render the same field but not trimmed (to display it in an overlay div).

Thanks for helping...

found an answer...
Source Link
mix
  • 61
  • 7

I have a content type with a text field that i want to render trimmed and full in the same node.

I've set my field to "trimmed" and rendered it in my node.tpl.php using
<?php print render($content['field_image_desc']); ?>

Now i need to render the same field but not trimmed (to display it in an overlay div).

Thanks for helping...

[edit]

i answer myself:

inside node.tpl.php, this is rendering a trimmed version of my field

<?php 
     print render(field_view_field('node', $node, 'field_myfieldname', array(
        'label'=>'hidden', 
        'type' => 'text_summary_or_trimmed', 
        'settings'=>array('trim_length' => 30),
    )));
?>

and then i render my 'default' format field like always

<?php print render($content['field_image_desc']); ?>

I have a content type with a text field that i want to render trimmed and full in the same node.

I've set my field to "trimmed" and rendered it in my node.tpl.php using
<?php print render($content['field_image_desc']); ?>

Now i need to render the same field but not trimmed (to display it in an overlay div).

Thanks for helping...

I have a content type with a text field that i want to render trimmed and full in the same node.

I've set my field to "trimmed" and rendered it in my node.tpl.php using
<?php print render($content['field_image_desc']); ?>

Now i need to render the same field but not trimmed (to display it in an overlay div).

Thanks for helping...

[edit]

i answer myself:

inside node.tpl.php, this is rendering a trimmed version of my field

<?php 
     print render(field_view_field('node', $node, 'field_myfieldname', array(
        'label'=>'hidden', 
        'type' => 'text_summary_or_trimmed', 
        'settings'=>array('trim_length' => 30),
    )));
?>

and then i render my 'default' format field like always

<?php print render($content['field_image_desc']); ?>
Source Link
mix
  • 61
  • 7

How to display the trimmed value and the full value of a field in a same node

I have a content type with a text field that i want to render trimmed and full in the same node.

I've set my field to "trimmed" and rendered it in my node.tpl.php using
<?php print render($content['field_image_desc']); ?>

Now i need to render the same field but not trimmed (to display it in an overlay div).

Thanks for helping...