Using template event files in styles

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The next feature release of phpBB 3 will be 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.2.x. If you need support for phpBB 3.2.x please visit the 3.2.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Post Reply
leschek
Registered User
Posts: 163
Joined: Tue Aug 28, 2012 1:30 pm

Using template event files in styles

Post by leschek » Sun Jul 12, 2015 10:20 pm

As the phpBB Ideas page is still not available I'm writing here.

I think it would be nice to be able to use template event files in styles in the same way as they are used in extensions. I can imagine that users would create folder called "event" in template folder in style (or substyle) and in it they could create html event files with some custom code, so they wouldn't have to edit core files of style. Also, it would be easier for users to update changed styles to newer version as new custom code would be in separate files.

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

Re: Using template event files in styles

Post by javiexin » Sun Jul 12, 2015 11:44 pm

Wouldn't this be as simple as creating a new extension directory, a new composer.json file, enable it as an extension, and there you go: just put whatever template events you want to customize in the styles folder of that "empty" extension...

I might have left some minor detail (maybe create the ext.php file, but I am not positive it is required), but conceptually, this would be almost exactly what you are asking for, only in a different folder (under ext/ instead of under styles/).

-javiexin

leschek
Registered User
Posts: 163
Joined: Tue Aug 28, 2012 1:30 pm

Re: Using template event files in styles

Post by leschek » Mon Jul 13, 2015 8:49 am

Thank you for reply.
javiexin wrote:
Sun Jul 12, 2015 11:44 pm
Wouldn't this be as simple as creating a new extension directory, a new composer.json file, enable it as an extension, and there you go
No. I think it would be simpler (and for users easier) to create only one directory in template folder and (to me) it seems to be more logical to edit style in style directory than to create extension for it and edit files in extension. But you are right, it's possible to create extension for editing styles.

Khaos-Rage
Registered User
Posts: 35
Joined: Wed Aug 06, 2014 12:27 am

Re: Using template event files in styles

Post by Khaos-Rage » Mon Jul 13, 2015 6:08 pm

This has been done already.

Extension Name: Custom Code

Extension Description: Allows to add custom template code on template event locations.

leschek
Registered User
Posts: 163
Joined: Tue Aug 28, 2012 1:30 pm

Re: Using template event files in styles

Post by leschek » Mon Jul 13, 2015 7:12 pm

Khaos-Rage wrote:
Mon Jul 13, 2015 6:08 pm
This has been done already.

Extension Name: Custom Code

Extension Description: Allows to add custom template code on template event locations.
While I like that extension it is different thing. For example there is only limited number of events user can use.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1830
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Using template event files in styles

Post by DavidIQ » Tue Jul 14, 2015 1:29 am

Doesn't sound like a bad idea. I imagine it would simply contain user created files that have the template event name just like extensions do it. Then those forum administrators that just want to add a simple menu item, for instance, without the complexities of an extension can just do so.

I would lay out the details in a tracker ticket if I were you.
Image

Post Reply