I have run into a problem where I am needing to duplicate a bunch of views---...tpl.php files.

I see 'template_files' in the views_preprocess hook, but dont really understand how to get that files used or how to make it suggested for a specific field.

My problem is, for nodequeues, I need to override the field->title with some cck field if it exists, otherwise I need to just the field->title.

This is easy and straight forward, but leaves me making
/var/www/sites/all/themes/framework/views-view-field--nodequeue-1--block--title.tpl.php
/var/www/sites/all/themes/framework/views-view-field--nodequeue-2--block--title.tpl.php
/var/www/sites/all/themes/framework/views-view-field--nodequeue-3--block--title.tpl.php
/var/www/sites/all/themes/framework/views-view-field--nodequeue-4--block--title.tpl.php
...

So I want to somehow get in there and suggest a specific one.

Comments

dawehner’s picture

Status: Active » Fixed
I see 'template_files' in the views_preprocess hook, but dont really understand how to get that files used or how to make it suggested for a specific field.

You have to detect the cases where you want to have your suggestions. For example

if (strpos('nodequeue', $view->name) !== FALSE) {
}

So only if this condition is true add a theme suggestion perhaps with a special naming.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.