Drupal 7 Views - How to access unformatted $row variable in a custom template?

前端 未结 3 1010
无人及你
无人及你 2021-01-12 15:29

I just installed Views module for Drupal 7 and am trying to find out how to customize it.

So far, I have done the following things.

  1. Created a content t
相关标签:
3条回答
  • 2021-01-12 15:57

    You should to use fields templates not 'Display', 'Style', or 'Row'.

    Or you can use both fields in 'Row' template. Ex:

    print $fields['you_field_value']->raw;
    

    Name of 'you_field_value' show as part of link in fields list of view display.

    0 讨论(0)
  • 2021-01-12 16:15
    print $fields['your_field_value']->raw;
    

    did not work for me, however the following did in my case.

    $row->field_YOUR_FIELD[0]['rendered']['#markup'];
    
    0 讨论(0)
  • 2021-01-12 16:20

    Or to get the value of field:

    print $fields['field_pretitle_front']->content;
    
    0 讨论(0)
提交回复
热议问题