This is tricky to explain properly...
I have a view, and I want to override the output of one of the fields, so I created a template.tpl.php file, called:
views-view-field--frontpage-fold--page--field-video-background-files.tpl.php
I at first had the logic in that file, and everything worked as expected. Great!
Then to conform with best practice, I moved the logic part (that was at the start of my .tpl.php file), to a theme function override thingy. This looks like:
function MY_THEME_views_view_field__frontpage_fold__page__field_video_background_files(&$variables) {
And that works fine... With an exception.
THEY DON'T WORK TOGETHER!
Depending on how I fiddle around with clearing caches, and using views 'Rescan Template Files' button, I either get one working, or the other. Not both.
The result of this is that it's impossible to separate my logic into a template.php file and pass variables to my .tpl.php file.
Does anyone have any idea why this might be?
I'm fairly new to Drupal, and have found the following pieces of information, but don't quite understand what they're saying...
https://stackoverflow.com/questions/10433853/drupal-7-preprocess-views-not-working https://stackoverflow.com/questions/2383865/how-do-i-use-theme-preprocessor-functions-for-my-own-templates/2387782#2387782 https://www.drupal.org/node/939462
Can anyone clear this up for me, and suggest a solution?