Download & Extend

A fix for too short replace field in "Text Simple Replace"

Project:Flexifilter
Version:6.x-1.2
Component:Code - Components
Category:feature request
Priority:minor
Assigned:Unassigned
Status:needs review

Issue Summary

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.

Comments

#1

+1

#2

+1

#3

Patched attached.

AttachmentSize
flexifilter-399486.patch 800 bytes

#4

Version:6.x-1.1-rc2» 6.x-1.2
nobody click here