[Typo3-dev] Permission: I enhanced Auto-parse Template

Sam Liddicott sam at liddicott.com
Tue Jul 1 21:54:27 CEST 2003


This message considers the limits to enhancing Auto-parse template

To start with, I added ereg_replace to go with str_replace, but it's hardly
worth posting the diff, it would be quicker to cut'n'paste like I did.  Its
an important enhancement when you consider the vast number of templates "out
there" and they may need a bit of auto-massaging to fit.

I can now do stuff like this, which as you can see covers a variety of
markup.

elements.BODY.ereg_replace {
  10 {
    value= <!--*[^>]*content[^>]*>
    replaceWith= <div class="content">
  }
  20 {
    value=<!--*>
    replaceWith="</div>
  }
}

and then treat
elements.DIV.content

as normal.

But I thought I may as well do a generic replace so I can do
elements.BODY.replace.10 {
  function=ereg_replace
  value=....

you get the idea, and a bit of eval in the code, perhaps along with
function_exists?
Any idea why not?

I would want this adding to the official module so I am consulting with you
all on the direction I am making it take.

Sam






More information about the TYPO3-dev mailing list