07-24-2023, 08:52 AM
<p>I have several .tpl.php files for nodes, CCK fields, and Views theming. These template files have a lot of logic in them to move things around, strip links, create new links, etc. I understand that this is bad development and not "The Drupal Way".</p>
<p>If I understand correctly, "The Drupal Way" is to use preprocessor functions in your <code>template.php</code> file to manipulate variables and add new variables. A few questions about that:
<ul>
<li>Is there a naming convention for creating a preprocessor function for a specific theme? For example, if I have a CCK field template called <code>content-field-field_transmission_make_model.tpl</code>, how would I name the preprocessor function?</li>
<li>Can I use template preprocessor functions for node templates, CCK field templates, and Views templates? Do they have different methods of modifying template variables or adding new ones?</li>
</ul>
<p>If I understand correctly, "The Drupal Way" is to use preprocessor functions in your <code>template.php</code> file to manipulate variables and add new variables. A few questions about that:
<ul>
<li>Is there a naming convention for creating a preprocessor function for a specific theme? For example, if I have a CCK field template called <code>content-field-field_transmission_make_model.tpl</code>, how would I name the preprocessor function?</li>
<li>Can I use template preprocessor functions for node templates, CCK field templates, and Views templates? Do they have different methods of modifying template variables or adding new ones?</li>
</ul>