event folder

Discussion forum for Extension Writers regarding Extension Development.
User avatar
MarkDHamill
Registered User
Posts: 3805
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

event folder

Post by MarkDHamill » Fri Jun 21, 2019 12:25 am

Am I understanding this wrong? This is not part of an extension, just some work I am doing for a client. I am trying to add some text before the username field on the registration form. In the template, I see an event:

Code: Select all

<!-- EVENT ucp_register_credentials_before -->
So I create an event folder /styles/prosilver/template/event.

Inside I create a file ucp_register_credentials_before.html with the content:

Code: Select all

<p>We encourage you to use your real name or if it is not available, a variation of it like Steven H, SteveH or Steveo etc.</p>
I purge the cache, make sure I'm logged out, purged my browser cache and try the registration. After going through the terms though, I don't see the text before the username field.

I tried putting it in the /all folder but that didn't make any difference.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
</Solidjeuh>
Registered User
Posts: 1605
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: event folder

Post by </Solidjeuh> » Fri Jun 21, 2019 12:51 am

Register a free account & Play!!
~~~ https://www.solidjeuh.be ~~~
Have a secret? --> https://www.tellyoursecrets.eu

User avatar
MarkDHamill
Registered User
Posts: 3805
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: event folder

Post by MarkDHamill » Fri Jun 21, 2019 12:54 am

Stuff like this works in my extension too. I assumed the logic would work outside of an extension for minor customizations for clients. Perhaps not?
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
3Di
Former Team Member
Posts: 13766
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: event folder

Post by 3Di » Fri Jun 21, 2019 12:59 am

Where did you create such folder? And no, this works only with extensions.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
MarkDHamill
Registered User
Posts: 3805
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: event folder

Post by MarkDHamill » Fri Jun 21, 2019 1:06 am

It's not in the extension. It's in the main file system, ex /styles/prosilver/template/event.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
3Di
Former Team Member
Posts: 13766
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: event folder

Post by 3Di » Fri Jun 21, 2019 1:09 am

See above, in fact.

You can add your HTML right underneath such event though. Hard-coding.
Or code a small extension.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
MarkDHamill
Registered User
Posts: 3805
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: event folder

Post by MarkDHamill » Fri Jun 21, 2019 1:19 am

I was hoping to avoid hard coding in a template itself because upgrades will overwrite them. Thanks for your insight.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
canonknipser
Registered User
Posts: 1995
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: event folder

Post by canonknipser » Fri Jun 21, 2019 8:51 pm

Just create a child style of prosilver only containing the child style relevant stuff (mainly style.cfg and relevant folders) and a adapted copy of the registration form, and make it default for guests.
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

User avatar
MarkDHamill
Registered User
Posts: 3805
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: event folder

Post by MarkDHamill » Fri Jun 21, 2019 10:07 pm

That's essentially what I did. The only problem is that if a template is copied from the base style like prosilver, the base template may have changes made to it over time. The only way to catch those changes is to periodically look at the template comparing it with previous versions and apply them to your custom style.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
mrgoldy
Jr. Extension Validator
Posts: 1047
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs

Re: event folder

Post by mrgoldy » Sat Jun 22, 2019 8:45 pm

Then create the tiniest of extension using just that style event. Does the trick, right?
phpBB Studio / ''Proud member of the Studio"

User avatar
MarkDHamill
Registered User
Posts: 3805
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: event folder

Post by MarkDHamill » Sun Jun 23, 2019 3:14 pm

It's a pretty common pattern for board owners to want to make little changes to templates. A custom style allows them to make style changes. I hope the developers of phpBB will allow users to create event folders in their template folders and have it hook into these template events by design. I will submit this is an enhancement request.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
3Di
Former Team Member
Posts: 13766
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: event folder

Post by 3Di » Sun Jun 23, 2019 9:49 pm

3Di wrote:
Fri Jun 21, 2019 1:09 am
...
... code a small extension.
;)
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
EA117
Registered User
Posts: 630
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: event folder

Post by EA117 » Sun Jun 23, 2019 10:41 pm

mrgoldy and 3Di wrote:code a small extension.
No one is denying that a small extension could leverage these event templates. Only that being able to leverage them from within a regular style would also be useful, and would provide additional flexibility for creating inherited styles that are less affected by future changes to the parent style.

If "the only thing" someone wanted to change was something that could be addressed by the event template, then yes, creation and delivery of "just a small extension" to provide that functionality could be 100% of the "modified style" delivery. Albeit via a method perhaps less familiar to style-only designers, or to site owners trying to modify their own styles through template and CSS-level changes.

But if the style also needs to deliver one or more full template replacements -- in addition to also being able to avoid one or more additional full template replacements by using the event templates instead -- now the "modified style" must be delivered "as both a style and a companion extension." Which overall makes things more complicated, as compared to if these event templates were simply expected and supported within regular styles.

The proposed enhancement is useful, and "not out of line" with templating that phpBB already willingly supports. That the templating support within a regular style could also support these events seems like a both logical and useful flexibility. So I too hope it could be eventually considered and integrated.

User avatar
3Di
Former Team Member
Posts: 13766
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: event folder

Post by 3Di » Sun Jun 23, 2019 10:53 pm

In the meantime that everyone hopes that this or that will happen here there is a problem to be solved very specifically and for which help has been sought. In this case the help has been given, write (or use skeleton ext on purpose) a small extension and the problem is solved in 5 minutes, much less than all the time spent so far discussing potential (maybe) features that I never think will see the light of day.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

User avatar
MarkDHamill
Registered User
Posts: 3805
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: event folder

Post by MarkDHamill » Sun Jun 23, 2019 11:05 pm

Clearly it wasn't obvious to me that phpBB had this limitation, as it seemed logical that it should and custom styles already provides a level of insulation for custom styles through inheritance from a parent style. Most board owners probably aren't extension developers and it won't be obvious what the solution is, surely not a five minute solution. Hope my enhancement request get adopted as it will nicely complement the custom style capability as well as provide a level of consistency to phpBB.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

Post Reply

Return to “Extension Writers Discussion”