How can I access/print the raw value of a date field? (or any field for that matter). I am working in a View template and I typically use $fields['field_myfield']->content. But that gives me the HTML not just the value.
My template.php file:
function mytheme_preprocess_views_view_fields(&$variables) { $view = $variables['view']; if($view->name == "news_main_list") { $variables['news_date'] = $variables['fields']['field_news_date_text']->content; $variables['news_type'] = $variables['fields']['field_news_type']->content; $variables['theme_hook_suggestions'][]='views_view_fields__news_main_list__block_1'; } } My views-view-fields--news-main-list--block-1.tpl.php file:
<?php if (!empty($field->separator)): ?> <?php print $field->separator; ?> <?php print $field->wrapper_prefix; ?> <?php print $field->label_html; ?> <p class="newsTitle"><?php print $fields['title']->content; ?></p> <p class="dateByLine"> <?php print $news_date; ?> | <?php print $news_type; ?> <?php if ($news_type == "event") : ?> <?php print 'hello'; ?> <?php endif; ?> </p> <?php print $field->wrapper_suffix; ?>