In phpBB 3.0.X MODX files, there were a number of modification methods for modifying the template files that were very commonly used, but are not possible in phpBB 3.1:
[ REPLACE WITH ]
[ REMOVE ]
[ INLINE REPLACE WITH ]
[ INLINE REMOVE ]
As a result, extensions can only add new template code, but can not modify or remove core template code. The current workaround is to hope a block of template code you want to modify or remove has an ID selector, which you can use to manipulate using CSS or JS.
However, a proper/simpler method for changing template code should be provided.
Things that need to be ironed out:
1) The syntax?
2) How it should work, like the EVENTs or some other way (Twig blocks/inheritance?, PHP processing?)
3) What to do when two or more extensions want to modify the same piece of code?
Here's a ticket for this posted a while back:
https://tracker.phpbb.com/browse/PHPBB3-12019
[RFC] Template Modify/Replace by Extensions
[RFC] Template Modify/Replace by Extensions
Has an irascible disposition.
Re: [RFC] Template Modify/Replace by Extensions
This can be done in the phpBB already by using events to insert conditionals.
Formerly known as Unknown Bliss
No unsolicited PMs please except for quotes.psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
Re: [RFC] Template Modify/Replace by Extensions
No, we (EXreaction and I) actually tried that already. It does not work. Trying to use events to insert conditionals just broke things, and left you with half-rendered output. IIRC, it was because each template event is rendered on its own in TWIG, and therefor it appears to have an opened condition that is not properly closed, so poof, broken PHP.MichaelC wrote:This can be done in the phpBB already by using events to insert conditionals.
Has an irascible disposition.
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: [RFC] Template Modify/Replace by Extensions
Which code are you thinking may need total replacing or modification?
Re: [RFC] Template Modify/Replace by Extensions
For example, my ABBC3 bbcode extension, needs to completely replace the core's bbcode posting buttons template code with new template code. I had to do it using CSS instead, but that's not ideal as the old template code is still delivered, just not displayed.EXreaction wrote:Which code are you thinking may need total replacing or modification?
Has an irascible disposition.
Re: [RFC] Template Modify/Replace by Extensions
Hum... That ain't good... I also need to do the same thing for the WYSIWYG editor :S.
Re: [RFC] Template Modify/Replace by Extensions
Have a look at my Search Posts extension. I was able to successfully replace viewtopic's
... or am I completely missing something?
'POSTER_POSTS'
with the code I wanted using a event. Obviously, this means the event has to be in place first.... or am I completely missing something?
Re: [RFC] Template Modify/Replace by Extensions
you successfully replaced a variable, not the HTML content that is in the .html file.
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: [RFC] Template Modify/Replace by Extensions
That sort of stuff should be more dynamically driven to start withVSE wrote:For example, my ABBC3 bbcode extension, needs to completely replace the core's bbcode posting buttons template code with new template code. I had to do it using CSS instead, but that's not ideal as the old template code is still delivered, just not displayed.EXreaction wrote:Which code are you thinking may need total replacing or modification?
-
- Registered User
- Posts: 11
- Joined: Sat Aug 23, 2014 7:24 pm
Re: [RFC] Template Modify/Replace by Extensions
Has there been any solution to this after all this time?