This is a list of plugins for the Feeds Tamper contributed module.
Date/time
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.
Unix timestamp to Date
Converts a Unix timestamp to a date string using PHP's date() function.
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').
Filter empty items
If there are no values for a multi-valued field this plugin removes the empty row for this field. Else labels will show up even though there aren't any values for it.
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
Cast to integer
Convert a user-specified string to an integer.
Format a number
Add a user-specified number of decimal places, decimal point, and thousands separator.
Mathematical operation
Add, subtract, multiply or divide a number.
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 Alpha-2 code.
Entity Field Query finder
Searches for an entity based on a property or field of that entity and returns the entity id.
Full U.S. state name to abbrev.
Converts a string from a U.S. full state name name string to the two character abbreviation. For example, "alabama" will be converted to "AL".
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.
NB: Regex syntax must enclosure by "/"
Example: /[^a-Z]/
Format string
Formats a string using PHP's sprintf() function.
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.
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.
URL Decode
Decodes an URL-encoded string using PHP's urldecode() function.
URL Encode
URL-encodes a string using PHP's urlencode() function.
Attachment | Size |
---|---|
drupal field tamper plugin regex.png | 38.76 KB |
Comments
The 'Convert to boolean' plug-in does not work out-of-the-box
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.
This has been fixed in version 7.x-1.x-dev.
@miltonsp: hi, you should
@miltonsp: hi, you should fill a bug report in order to get it fixed.
Thanks for the support!
--
by FiNeX
FiNeX.org
Siti Web Vicenza
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
Dependency Plugin
At times, you may want the output of a field to be dependent on another field. That is, if the controlling field is 'false', the current field output should be blank.
The 'dependency' plugin will allow you to select the controlling field.
Here is the code for dependency.inc :
To install this code, encapsulate this code in 'dependency.inc' and place it in the feeds_tamper/plugins/ directory.
Dependency Plugin code in a patch file
Strip Slashes
For newbs.
Add plugin: Execute php code
PHP Code:
return stripslashes($field);
Which filter to use - Feed Tamper
Below Mentioned is just a single field . Any experts please suggest , how do I only filter out the BRAND - "ASDA Furniture " from this.
s:947:"O:8:"stdClass":14:{s:7:"Binding";s:14:"Kitchen & Home";s:5:"Brand";s:16:"ASDA Furniture";s:3:"EAN";s:13:"5055721699496";s:7:"EANList";O:8:"stdClass":1:{s:14:"EANListElement";s:13:"5055721699496";}s:7:"Feature";a:5:{i:0;s:68:"APPROX 10 INCH COIL SPRING MEMORY FOAM MATTRESS + 14 INCH DIVAN BASE";i:1;s:57:"12.5 GAUGE SPRING WITH 4CM VISCO MEMORY FOAM LAYER ON TOP";i:2;s:31:"MEETS ALL UK SAFETY REGULATIONS";i:3;s:24:"UK FIRE RETARDANT BS7177";i:4;s:57:"MANUFACTURED BY JOSEPH INTERNATIONAL FOR BED EXPRESS ONLY";}s:5:"Label";s:16:"Joseph Furniture";s:12:"Manufacturer";s:16:"Joseph Furniture";s:5:"Model";s:16:"DLOLMEMBCBRDDB50";s:12:"ProductGroup";s:7:"Kitchen";s:15:"ProductTypeName";s:24:"HOME_FURNITURE_AND_DECOR";s:9:"Publisher";s:16:"Joseph Furniture";s:4:"Size";s:22:"UK King (150 x 200 cm)";s:6:"Studio";s:16:"Joseph Furniture";s:5:"Title";s:88:"DIVAN BED WITH 10 INCH MEMORY FOAM QUILTED MATTRESS - ALL SIZES AVAILABLE (5'0 kingsize)";}";
This looks like serialized
This looks like serialized PHP. You can use unserialize() to transform it into a stdClass object.
See above for executing PHP.