Projet

Général

Profil

Paste
Télécharger (2,48 ko) Statistiques
| Branche: | Révision:

root / htmltest / sites / all / modules / views / help / analyze-theme.html @ a5572547

1
<p>Clicking on the "Theme: Information" link provides you with a listing of all posiible theming files. The highlighted files are the ones Views is currently using. All other filenames are suggested templates.</p>
2
<p>You may use any of the following possible theme files to modify individual parts of your view. In total, there are four parts to theming a view.</p>
3
<ul>
4
  <li> The <strong>display</strong> theme is usually views-view.tpl.php and it largely controls the decorations around a view; where the header, footer, pager, more link, feed icon, etc, will be placed. </li>
5

    
6
  <li> The <strong>style</strong> will control how all of the results of the display are put together. It may be as simple as just displaying all of the rows, or it may be a complex table generator or something in between. </li>
7

    
8
  <li> The <strong>row</strong> style controls each individual row; not all styles utilize the row style (notably the table), but most others do.
9

    
10
  <li> Finally, <strong>field</strong> themes allow you to override the look and even the data of each individual field, if the style uses fields. The actual template the system will use should be hilighted in <strong>bold</strong>.</li>
11
</ul>
12

    
13
<div class="help-box" style="text-align:center">
14
<a href="path:images/style-breakdown-large.png"><img src="path:images/style-breakdown.png" /></a>
15
<em>A breakdown of View output</em>
16
</div>
17

    
18
<p>The link to the left of each type will give you information about the default template used for that type. You may cut and paste this and place it in your theme with the appropriate template, or you may copy the base file from the views/theme directory (or, if provided by a module, from the module's directory). <strong>It is important that you clear the theme registry cache every time you add a new template, or the new template will not be picked up.</strong></p>
19

    
20
<p><strong>Important note:</strong> You place your custom template files in your theme directory, <strong>not views/theme</strong>. This is always true of theming with Drupal.
21

    
22
<p>In addition to this tool, the very useful <a href="http://drupal.org/project/devel">devel</a> module contains a tool called the "Theme developer" which does a good job of visually showing you which areas of your site use which themes. Be careful with it, though, as the theme developer causes the Views edit page to break.</p>
23

    
24
<p>Also, this feature will only work properly with Drupal 6.3 and later; prior to Drupal 6.3 <a href="http://drupal.org/node/241570">this patch</a> will be required.</p>