Community Documentation

Plugin list

Last updated January 5, 2013. Created by twistor on August 11, 2011.
Edited by Jeffrey C., Mile23, chrisjlee, froboy. Log in to edit this page.

This is a list of plugins for the Feeds Tamper contributed module.

Filter

Keyword filter

Only import (or do not import) items that contain a list of specific words/phrases

Required field

Make this field required. If it is empty, the feed item will not be saved.

HTML

HTML entity decode

Convert all HTML entities such as & and " to & and ".

HTML entity encode

Convert all HTML special characters such as > and & to > and &.

Make URLs absolute

Make URLs in markup absolute. (i.e. <a href="/stuff/things"> to <a href="http://example.com/stuff/things">).

Strip tags

Remove all HTML tags except a user-specified list.

List

Explode

Break up sequenced data into an array with the option of setting a limit to the number of items returned. For example, "a, b, c" would get broken up into the array('a', 'b', 'c').

Implode

Join array elements into a string using an user-specified "glue". For example, array('a', 'b', 'c') with glue "," would become "a, b, c".

Unique

Makes the elements in a multivalued field unique.

Number

Format a number

Add a user-specified number of decimal places, decimal point, and thousands separator.

Other

Calculate hash

Makes the value a hash of the values being imported. This allows for importing content that does not have a unique ID.

Copy source value

Copy the selected source to or from another source in the feed.

Country to ISO code

Converts a field from a country name string to the two character ISO 3166-1 alpha-2 code.

Rewrite

Rewrite the source using token-based replacement. Each source in the feed is available as a token and available to append or reorder into a single string.

Example: [sku] is a number and a image string can be created from it.
http://example.com/sites/all/files/images/[sku].jpg

Set default value

Set a static default value for the field.

Text

Convert case

Convert to "Title Case", "lower case", or "UPPER CASE".

Convert to boolean

Convert a user-specified string to boolean, with the option of specifying what to do in the case of no match.

Find replace

Find and replace a user-specified word/phrase.

Find replace REGEX

Find and replace a user-specified string using REGEX with an option to limit the number of replacements. See the PHP Manual on PCRE Pattern Syntax for a complete reference, or RegexPal for a quick tester.

Pad a string

Increase the length of a string to a minimum value using a user-specified string on the right, left, or both sides.

String to Unix timestamp

Take a string containing an English date format and convert it into a Unix Timestamp. See the PHP Manual on strtotime for examples of valid strings.

Trim

Trim a user-specified string from the left, right, or both sides of the source.

Truncate

Limit the source to a user-specified number of characters, with the option of adding ellipses to the end of the truncated text.

Comments

The 'Convert to boolean' plug-in does not work out-of-the-box in Drupal 7.
Here is a small patch to make it work.


Index: .../feeds/feeds_tamper/plugins/convert_boolean.inc
===================================================================
--- ... /feeds/feeds_tamper/plugins/convert_boolean.inc
+++ ... /feeds/feeds_tamper/plugins/convert_boolean.inc
@@ -79,11 +79,11 @@
     $match_field = drupal_strtolower($match_field);
   }
   if ($match_field == $settings['true_value']) {
-    $field = TRUE;
+    $field = 1;
     return;
   }
   if ($match_field == $settings['false_value']) {
-    $field = FALSE;
+    $field = 0;
     return;
   }
   if ($settings['no_match'] == 'pass') {

MS

@miltonsp: hi, you should

@miltonsp: hi, you should fill a bug report in order to get it fixed.

Thanks for the support!

Thanks, that worked for

Thanks, that worked for Boolean values :)

convert text to date?

will be usefull

get Copy source value into another plugin

How do i reference the "Copy source value" in another plugin on the same field? i want to copy the RSS description field into two targets. 1 target for field_body and 1 target for field_image. I want to copy source value to field_image and then using Feeds Tamper PHP run a REGEX to extract a jpg image from field_body to use in field_image.
thanks
lee

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 6.x, Drupal 7.x
Audience
Site administrators, Site users

Site Building Guide

Drupal’s online documentation is © 2000-2013 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. Comments on documentation pages are used to improve content and then deleted.