XF 1.2 Template modification - Add content at the end

Rigel Kentaurus

Well-known member
This should be a very basic question, I am trying to add content at the end of the template

I figured I could that with Regex, however, when I set it up as ..

Regular Expression:
Code:
^(.*)$

Substitution:
Code:
$0 MY_CONTENT

That does not work. It tells me the Regex is not valid. What is the correct way of doing this?
 
This is what I have been using:

Code:
/<dl class="ctrlClass">(.*?)<\/dl>/is

Replace:

Code:
$0 YOUR_CONTENT

I think the thing missing from your regular expression is the delimiter and modifier. So I wonder if this works:

Code:
/^(.*)$/is
 
It's not weird. PHP regex always requires delimiter and modifier.

Unless you mean you feel XF should apply one automatically. In which case this way gives us more control, I guess.
 
Yeah, I would've expected XF to add that for me. My reasoning is that the user should not be aware of the language underneath. I use regexes on my text editor all the time, I don't care if the text editor is implemented in perl, python, or C :)

Anyway, thanks. That worked like a charm.
Code:
/^(.*)$/is
that works
 
Top Bottom