You are here

function taxonomy_image_help in Taxonomy Image 5

Same name and namespace in other branches
  1. 6 taxonomy_image.module \taxonomy_image_help()

Implementation of hook_help.

File

./taxonomy_image.module, line 284
taxonomy_image.module Simple module for providing an association between taxonomy terms and images. Written by Jeremy Andrews <jeremy@kerneltrap.org>, May 2004.

Code

function taxonomy_image_help($section) {
  switch ($section) {
    case 'admin/content/taxonomy/taxonomy_image':
      if (user_access('administer taxonomy images')) {
        $settings = '<p>' . l(t('Taxonomy Image settings'), 'admin/settings/taxonomy_image') . '</p>';
      }
      else {
        $settings = NULL;
      }
      return t('The taxonomy_image module allows site administrators to associate images with category (taxonomy) terms.  Once defined, this association allows Drupal themes to display images with site content.  For example, this module might be used to display a penguin with content about Linux, and a cheeseburger with content about junk food. To modify or delete an existing image or to upload a new image, click "edit image" on the overview page or use the term edit page.  To learn more about how to create vocabularies and terms, review the <a href="!taxonomy-help">taxonomy help page</a>.', array(
        '!taxonomy-help' => url('admin/help/taxonomy'),
      )) . $settings;
    case 'admin/help#taxonomy_image':
      $output = t('<h3>Introduction</h3>
      <p>The taxonomy_image module allows site administrators to associate images with category terms.  Once defined, this association allows Drupal sites to display images with site content.  For example, the taxonomy_image module might be used to display a penguin with content about Linux, and a cheeseburger with content about junk food.</p>
      <p>The module allows both a one-to-one term-to-image relationship, and a many-to-one terms-to-image relationship.</p>
      <p>The taxonomy_image module requires that the taxonomy module also be enabled. The Categories module is not currently supported.</p>
      <h3>Configuration</h3>
      <h4>Uploading images</h4>
      <p>With the taxonomy_image module enabled, images can be uploaded and associated with category terms at "Administer >> Content management >> Categories".  On that page you will find links to tables containing all your vocabularies and terms.  Next to each term is a link titled "edit term" which you can click to upload an image for that term.  After clicking that link, you will be you will find the image management section at the bottom of that page. Using the "browse" button you can select your image then click "Save".
      <p>Continue this process to upload appropriate images for your category terms.  Note that by default images will be displayed at the size they were uploaded.  Alternatively, you can go to "Administer >> Site configuration >> Taxonomy_image" to set the display height and/or width of all taxonomy images.</p>
      <h4>Permissions</h4>
      <p>For your users to be able to view the images you have uploaded, you will need to give them the necessary permissions.  Only users with the "access taxonomy images" permission will see images.  If you wish to give your users the ability to disable the images, also give them the "can disable taxonomy images" permission. A third permission, "administer taxonomy images", controls which users are allowed to configure taxonomy images.</p>
      <h4>Recursive image display</h4>
      <p>Taxonomy is a very powerful tool. One of its features is providing the ability to create hierarchical vocabularies, with which you can build a tree of terms.  It is possible that an entire tree of terms, or even just a branch of terms, are all about a similar subject and should all be associated with the same image.  By going to "Administer >> Site configuration >> Taxonomy_image", you can enable "Recursive image display".  With this option enabled, you only need to configure an image for the parent term, and all children will automatically inheret the same image (unless they are manually configured to display an alternate image).</p>
      <h3>Displaying images</h3>
      <p>To actually display images, you will have to make a call to taxonomy_image_display(). [There are some included add-on modules that will do this for you.]  When calling this function, you will need to pass in the taxonomy term for which an image should be displayed.  For example, from your theme\'s "_node" function you might do the following:
<pre>
  foreach (taxonomy_node_get_terms($node->nid) as $term) {
    if ($image = taxonomy_image_display($term->tid)) {
      $output .= \\"$image\\";
    }
</pre>
    <p>Taxonomy_image_display uses "theme(\'image\',..." so you may override the display in your theme layer.</p>
    ');
      if (module_exists('views')) {
        $output .= t('<h3>Views</h3><p>Views support has been added, so you can use the field "Taxonomy Image" in your view definition.</p>');
      }
      if (module_exists('imagecache')) {
        $output .= t('<h3>Imagecache</h3>
          <p>With imagecache enabled, you may use Imagecache profiles instead of image height/width. You can set a default profile on the settings page, or use it manually with taxonomy_image_display(), like this:</p>
<pre>
taxonomy_image_display($term->tid, NULL, \'PROFILE_NAME\');
</pre>
         <p>set <em>PROFILE_NAME</em> to whatever profile you want to use.</p>');
      }
      if (module_exists('taxonomy_image_node_display') || module_exists('taxonomy_image_link_alter')) {
        $output .= t('<h3>Add-on Feature Modules</h3>');
      }
      if (module_exists('taxonomy_image_node_display')) {
        $output .= t('<h4>Taxonomy Image Node Display</h4><p>With this add-on feature, Taxonomy Image will automatically include all available term-associated images into the display of selected node types. The weight option determines where in the output the image will be positioned. Another option specifies whether or not to add a "taxonomy/term/nn" link to each image. Configuration is part of the usual Taxonomy Image settings page.</p>');
      }
      if (module_exists('taxonomy_image_link_alter')) {
        $output .= t('<h4>Taxonomy Image Link Alter</h4><p>With this add-on feature, Taxonomy Image will automatically modify the standard taxonomy term display to use the term\'s image, if it has one. Configuration is part of the usual Taxonomy Image settings page.</p>');
      }
      if (module_exists('taxonomy_image_blocks')) {
        $output .= t('<h4>Taxonomy Image Blocks</h4><p>This add-on feature provides a block in which the terms and images are shown on full node display. Configuration is part of the usual block settings page.</p>');
      }
      return $output;
  }
}