Get fields values in the view I am new on Drupal and I need to update an existing Drupal 7 website.

The website is multi-domains, multi-languages.

Getting the views fields values makes me a big headache!



The existing code of the website is like this:

In the folder templates:

Each template of the website has a file like: views-view-unformatted--some-name.tpl.php

And the to print the fields values, the code is similar to this:

&lt;?php
$idInFieldCollection = $view-&gt;result[0]-&gt;field_field_a_name[0]['raw']['value'];
$item = $view-&gt;result[0]-&gt;field_field_a_name[0];
$value = $item['rendered']['entity']['field_collection_item'][$idInFieldCollection]['field_the_field_needed']['#items'][0]['value'];
?&gt;
&lt;span&gt;&lt;?php print($value); ?&gt;&lt;/span&gt;


This process seems huge!

And finding the path for each field value requires to use kpr() and explore the view object.

I don't understand so much yet all I read about Drupal, could you guys let me know if there is an easier way. With getters for example ?
You should use Entity module. in this module no matter what the language of the website is you can use entity_metadata_wrapper command to get the fields value. here is an example of my project where field_article_writer and title are fields of article content type:

function MYTHEME_preprocess_node(&amp;$variables){
switch ($variables['node']-&gt;type){
    case 'article':
        $suggest = "page__node__article";
        $variables['theme_hook_suggestions'][] = $suggest;
        $wrapper = entity_metadata_wrapper('node',$variables['node']);
        $variables['title']= $wrapper-&gt;title-&gt;value();
        $variables['writer']= $wrapper-&gt;field_article_writer-&gt;value();
        break;
    }
} 


Now in page--node--article.tpl.php, $title and $writer hold their correspondent value.