// $Id: $

Simple_media provides a method for CCK field data to be embedded in the other
fields using a filter.   Once set up content creators can upload images or other media
using a filefield or imagefield, and embed those media within the content body using
a simple [[token:#]] syntax, such as [[image:2]], which might embed the second image
of a list of unloaded imagefields in the node.

Tokens can be defined by administrators on a per field basis, and the delimiters can also
be changed if required.   Administrator created template files are utilized to the theme
the output of field data.

Simple media works by a 3 step process:

1) The filter leaves a placeholder in the filtered text: 
    e.g. <span class="simple-media" id="simple-media-field-image-3" />
2) hook_nodeapi is used to add data at $node->content['simple-media'] that is invisible
    in the browser by { display : none; }
3) On the browser, jQuery plucks out the rendered field data , and injects it into the
    placeholders created by the filter.

*** WARNING***  

Simple media requires javascript to be active on the browser, as it is used to pluck out the
rendered field data out of a hidden part of the page, and inject it into the placeholders
created by the filter.

Simple_media was written by Mark Sanford (mtsanford)

Dependencies
------------
 * Filter
 * Content

FileField and/or Imagefield are also recommended, as embedding of file based media
is the intended use of this module.  Imagecache is also recommended for sizing of images.

Install
-------

1) Copy the simple_media folder to the modules folder in your installation.

2) Enable the module using Administer -> Site building -> Modules
   (/admin/build/modules).
   

Configure
-------
   
1) Configure simple_media at admin/admin/content/types/simplemedia

    For each field defined, you can enter a token that will be recognized by the
    Simple Media filter.    For example if your field name is 'field_images' and 
    you enter a token of 'picture', the Simple Media filter will convert [[picture:#]]
    into a placeholder for CCK data of field_image.
   
2) Copy the simple-media.tpl.php template to your theme folder, and rebuild your
    theme registry by clearing the cache of some other method.

3) Create templates for all the fields you've defined tokens for.  In the example
    above, you would created a template called simple-media-images.tpl.php.
    See simple-media.tpl.php for hints.

4) Create an Input format that includes the Simple Media filter.


Development Path
------------------------

Better integreation with CCK formatters: In addition to simple-media-FIELD.tpl.php
templates, it would be nice to be able to use existing CCK formatters for rendering.

