Community Documentation

ImageField Extended

Last updated March 19, 2010. Created by Alan D. on October 5, 2009.
Log in to edit this page.

An extended ImageField widget that adds new form fields to an ImageField widget. All processing, including storage, is done via ImageField. This module simply allows you to easily extend the currently available form fields; alt, description, title, etc, and either let the themers to run their magic, you can use the Custom Formatter module or use the new CCK formatter to display the additional text fields (Help hiding the labels can be found here

  • Header image checkbox, usage has been at both the page and node level.
  • Featured teaser list image flag.
  • Block image of existing page's node.
  • Adding alternative links to the image
  • Extra info to the rendered image. Our main usage is to add new attributes for JScript. We haven't actually added a caption yet!
  • Embedded gallery of selected images
  • Security note

    Remember security if you handle the data yourself. The recommended method to handle the text fields are:

    Typical text field (no HTML)

    <?php
    $no_markup
    = isset($data['no_markup']['body']) ? check_plain($data['no_markup']['body']) : NULL;
    ?>

    Text field with tags (HTML)

    <?php
    # You can use filter_xss_admin for TRUSTED users.
    $free_text = isset($data['free_text']['body']) ? filter_xss($data['free_text']['body']) : NULL;
    ?>

    Rich text (WYSIWYG)

    <?php
    $rich_text
    = '';
    if (isset(
    $data['rich_text']) && !empty($data['rich_text']['body'])) {
     
    $rich_text = check_markup($data['rich_text']['body'], $data['rich_text']['format'], FALSE);
    }
    ?>

    Remember that the title from the key|title pairs is also user input. Run this through check_plain() too!

    The following pages are used to help demonstrate possible theming uses.

    Page status

    No known problems

    Log in to edit this page

    About this page

    Drupal version
    Drupal 6.x
    Audience
    Developers and coders, Themers

    Site Building Guide

    Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.
    nobody click here