[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/skinr/help/ -> templates.html (source)

   1  <div class="messages warning">This feature is still in experimental stages,
   2    therefore it should NOT be used on live sites. There are still issues with it
   3    that need to be worked out, and in general it will NOT be supported at the
   4    moment. Please do not report and issues on this unless they include patches or
   5    serious ideas about a way forward for this.
   6  </div>
   7  <p>At the moment, templates can be associated with a Skin, or just on their own:
   8  </p>
   9  <pre>
  10  skinr[rounded_corners][templates][] = rounded-corners-block
  11  skinr[rounded_corners][templates][] = rounded-corners-node</pre>
  12  <p>However, associating a template with a Skin doesn't automatically mean that
  13    file will be used. It needs to be selected manually in the UI.
  14  </p>
  15  <p>Also, since there are different variables and template file structures
  16    available per hook, it's necessary to provide template files for each type;
  17    hence, the -block, -node suffix. This is required, and will automatically
  18    filter out the template files that do no apply based on the -hook suffix.
  19    While this can still be incredibly useful as is, it's obviously not ideal. An
  20    implementation such as rounded corners would probably be better served as some
  21    type of wrapper template (like comment-wrapper does today). Ideas and patches
  22    to solve this issue are more than welcome.
  23  </p>
  24  
  25  <p>Some creative uses for template files could include:</p>
  26  
  27  <pre>
  28  skinr[extras][templates][] = minimal-block
  29  skinr[extras][templates][] = blank-block</pre>
  30  <p>By not specifying the regular widget options, like [title] and [description]
  31    for Skins, the widget is conveniently hidden in the UI, but the template still
  32    exists under advanced options. So, if you have a case where you don't need the
  33    extra markup like the block title and , you can switch the template file to
  34    use minimal-block.tpl.php and with the below in your template markup you'll
  35    only get the <code>$skinr</code> class and the block content.
  36  </p>
  37  <p>In the above example, minimal-block.tpl.php could contain the following
  38    markup:
  39  </p>
  40  <pre>
  41  &lt;div class=&quot;&lt;?php print $skinr; ?&gt;&quot;&gt;
  42    &lt;?php print $block-&gt;content; ?&gt;
  43  &lt;/div&gt;</pre>
  44  <p>You could also specify a blank-block.tpl.php, which could contain only the content:</p>
  45  <pre>&lt;?php print $block-&gt;content; ?&gt;</pre>
  46  <p>Both of these examples are useful for cases where you might otherwise be
  47    creating multiple template files for custom blocks just to remove markup,
  48    which can get unruly. In this case you can just assign the appropriate
  49    template file and be done with it, while keeping the number of template files
  50    in your theme manageable.
  51  </p>


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7