Themers

Term Fields - define fields for taxonomy terms

Last modified: November 13, 2009 - 02:21

This module enables you to add custom fields to the taxonomy terms of vocabularies via the web interface.
Summary - Why would I need 'term fields' ?
Drupal provides only title & description fields to terms & if you wish to have more fields to the terms forms you can make use of this module to define custom fields.
Module page: Term Fields

Theme a CCK input form for CCK2

Last modified: November 24, 2009 - 16:54

Spending several days for me to find out how to theming Input Form in CCK2 on Drupal 6, hope this can help you and save your time.

To theming CCK2 Input you just need:

  1. Edit template.php
  2. Create node-content_type-edit.tpl.php
  3. Clear Cache Data before view your result: Administer-Site Building-Performance: Clear Cache Data

EXAMPLE

Suppose your content-type is: "account_registration" and you theme is "bluemarine"

  1. Edit template.php, add this:
    <?php

    function bluemarine_theme($existing, $type, $theme, $path) {
      return array(
       
    'account_registration_node_form' => array(
           
    'arguments' => array('form' => NULL),
           
    'template' => 'node-account_registration-edit'
       
    )
      );
    }

    ?>

  2. Create node-account_registration-edit.tpl.php

    //To REMOVE Title field

    <?php
    unset($form['title']);
    ?>

    Company Data

    <?php

         
    //NOTE: if you don't have Field Group then simply type:
          // print drupal_render($form['field_accreg_company_name']['0']['value']);
         
    print drupal_render($form['group_company']['field_company']['0']['value']);
          print
    drupal_render($form['group_company']['field_street']['0']['value']);
       
    ?>

Confirmation Page Usage of Form Components or Variables

Last modified: October 10, 2009 - 04:22

It should be easier to format the confirmation page and capture form entries. Ideally, you would have access to all the form variables, and you could do this in a confirmation-page.tpl.php as well as in the confirmation page window under [webform]:Edit:Configuration. It took me a long time to find this tip on how to access form variables in confirmation pages.

Here is a very simple example to get you started, that I adapted from the above tip. Permit PHP code in your format and insert the following in the confirmation window of your [webform]:Edit:Configuration.

<?php
include_once(drupal_get_path('module', 'webform') .'/webform_submissions.inc');
$nid = arg(1); // need to hard-code nid if this is a custom page
$sid = $_GET['sid'];
$submission = webform_get_submission($nid, $sid);

$first_name = $submission->data[6]['value'][0];
$last_name = $submission->data[7]['value'][0];
$thanks = $first_name . " " . $last_name;
?>


<h2>Thank you <?php print $thanks ?>... Your registration has been sent.</h2>

Extending "Image with node link" function + Example safe uses of the three text fields.

Last modified: October 5, 2009 - 13:28

The CCK formatter theming function is "theme_imagefield_formatter_image_nodelink". The following is based on copying the ImageFields base function into the themes template.php file and renamed to "phptemplate_imagefield_formatter_image_nodelink";

It is based on having the following 3 additional textfields

no_markup|No markup allowed (textfield)
free_text|A textarea
rich_text|A WYSIWYG / textarea + formatting options

Enable and configure using the content type settings.

ImageField Extended

Last modified: October 5, 2009 - 13:16

An extended ImageField widget that adds new form fields to a ImageField widget. It provides no new theming functions, it just provides the framework to associate new data with an image.

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 leaves it up to the themers to run their magic.

We have used a single multivalue ImageField "Image, with additional fields" field to do all of the following in 3 projects.

  • 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

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

OpenLayers 2.x Documentation

Last modified: November 9, 2009 - 17:14

The OpenLayers 2.x Documentation Book includes documentation of the module for end-users as well as the API provided for developers.

New users should start with the OpenLayers 2.x Tutorial to build their first map.

Syndicate content