A fix for too short replace field in "Text Simple Replace"
Drupal_is_amazing - March 12, 2009 - 10:35
| Project: | Flexifilter |
| Version: | 6.x-1.1-rc2 |
| Component: | Code - Components |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Description
I often find myself wanting to have a short string of text be replaced with a large amount of static html code. Unfortunately, the simple search and replace component only has a short text field
In 'flexifilter.components.inc', line 173, I modified the function flexifilter_component_text_simple_replace:
original:
<?php
$form['replace'] = array(
'#type' => 'textfield',
'#title' => t('Replacement text'),
'#default_value' => isset($settings['replace']) ? $settings['replace'] : '',
'#required' => FALSE,
);
?>Replacement:
<?php
$form['replace'] = array(
'#type' => 'textarea',
'#title' => t('Replacement text'),
'#default_value' => isset($settings['replace']) ? $settings['replace'] : '',
'#required' => FALSE,
);
?>This just changes the textfield to a textarea, thereby allowing longer replacements.
Might be worth incorporating this change in the next version of Flexifilter-- a textarea can always hold a shorter section, but a textfield can't easily hold a larger.

#1
+1
#2
+1