2017 © Pedro Peláez
 

contao-bundle contao-replace-bundle

Helper contao bundle to perform a regular expression search and replace on front end page.

image

heimrichhannot/contao-replace-bundle

Helper contao bundle to perform a regular expression search and replace on front end page.

  • Tuesday, April 10, 2018
  • by digitales@heimrich-hannot.de
  • Repository
  • 5 Watchers
  • 0 Stars
  • 34 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 209 % Grown

The README.md

Contao Replace Bundle

, (*1)

Helper contao bundle to perform a regular expression search and replace on front end page., (*2)

Configuration

Currently it is only possible to search and replace globally. Open your contao settings and configure custom search and replace patterns., (*3)

Contao settings, (*4)

Examples

Wrap headline text in <span>

Before: <h1>Test A</h1> After: <h1><span>Test A<span></h1>, (*5)

  • Pattern: (<h\d[^>]*>)(.*)(<\/h[^>]*>)
  • Replacement: $1<span>$2</span>$3

Bootstrap 4 responsive tables

Before: <table><thead><tr><th>Value</th></tr></thead><tbody><tr><td>1</td></tr></tbody></table></body></html> After: <div class="table-responsive"><table class="table table-bordered table-hover"><thead><tr><th>Value</th></tr></thead><tbody><tr><td>1</td></tr></tbody></table></div>, (*6)

  • Pattern: (<table>)(.*)(<\/table>)
  • Replacement: <div class="table-responsive"><table class="table table-bordered table-hover">$2</table></div>

Before: <a href="tl_files/subfolder/files/file.pdf">Test link</a> After: <a href="files/backup/file.pdf">Test link</a>, (*7)

  • Pattern: (tl_files\/subfolder\/files\/)
  • Replacement: <div class="table-responsive"><table class="table table-bordered table-hover">$2</table></div>
  • Replace tags: true (checked)

The Versions