Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Element Text Change

Synopsis

Search and replace text in elements.

Version

  • 0.1.0

SS Versions

  • 7.1

  • 7.0

v7.1 Fluid Engine Compatible

Yes

Dependencies


Install

selectorTextSearchReplaceMap Example Data Structures

  • Replace [year] with result of a callback

          '#block-12345678901234567890 .sqs-html-content' : {
          
            searchText : '[year]',
            
            replaceText : twcEtcYear
            
            },
            

Callbacks

Following is a very generalized example of a callback. The callback(s) must be defined before the code of this effect. Note the use of var.

<script>

  var etcReplaceText = ( ) => {
  
    console.log ( 'etcReplaceText' );
    
    const r = 'replace text';
    
    return ( r );
    
    };
    
  </script>

Note

If the element returned by a selector has event listeners this code may break the functionality of the element. Modifying something relativley simple like a text block is not likely to be an issue. Something like a gallery block or gallery section may.

Make a Donation

Please consider making a donation.

Changes

  • 2024-06-28

    • initial version