Extensions load order

Discuss general development subjects that are not specific to a particular version like the versioning control system we use or other infrastructure.
Post Reply
Solidjeuh
Registered User
Posts: 8
Joined: Sat Feb 25, 2017 6:42 pm

Extensions load order

Post by Solidjeuh » Wed May 03, 2017 8:18 pm

I don't know if this is the right place to ask, but I saw this topic:
https://www.phpbb.com/community/viewtop ... #p14728611
And it's not the first time that I see the same question.
Can this be added in standard phpBB?

I think this is a function that will be used a lot..

User avatar
david63
Registered User
Posts: 215
Joined: Mon Feb 07, 2005 7:23 am
Location: Lancashire, UK

Re: Extensions load order

Post by david63 » Wed May 03, 2017 9:03 pm

As I understand from several topics where this has been discussed in the past this it is not possible with the current phpBB versions to specify the load order of template events.

I also believe that it may be possible once all styles move over to Twig where there are some additional features that can be used so I doubt that this will happen before the "new" phpBB style is created and released.
David
Remember: You only know what you know -
and you do not know what you do not know!

User avatar
javiexin
Registered User
Posts: 90
Joined: Thu Dec 22, 2011 10:04 am

Re: Extensions load order

Post by javiexin » Fri May 05, 2017 6:33 pm

Quick way around this. Beware as this will be lost any time that you install a new version of any of the affected extensions.

Say you have vendor1/extA and vendor2/extB extensions, both using event page_blah. And you want them to be loaded in the order A then B.

Then, you open: ext/vendor1/extA/styles/x/template/event/page_blah.html
At the beginning insert:

Code: Select all

<!-- IF not $INCLUDED_VENDOR1_EXTA -->
<!-- DEFINE $INCLUDED_VENDOR1_EXTA = true -->
And at the end of the file, insert:

Code: Select all

<!-- ENDIF -->
Now open: ext/vendor2/extB/styles/x/template/event/page_blah.html
At the beginning insert:

Code: Select all

<!-- IF not $INCLUDED_VENDOR1_EXTA -->
	<!-- INCLUDE @vendor1_extA/event/page_blah.html -->
<!-- ENDIF -->
That should do it, but please, test it and see if it does what you want.

Agree that this is a much needed feature. When I get the time (isn't that always the issue?) I will try to create such an extension at least.
Hope this helps,
-javiexin

Post Reply