Replacing a Template Between Two Events

Discussion forum for Extension Writers regarding Extension Development.
User avatar
Former Team Member
Posts: 16032
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco

Re: Replacing a Template Between Two Events

Post by 3Di »

javiexin wrote:Not sure why this is happening to you, it has worked for me always, from the SAME extension that is using it. I understand the prefix is needed when using a library from other extension, but from within the same one? Is it mandatory to include this? Since when? Not questioning, just asking... I have been "out of the game" for over a year, and might have missed it. Another comment: the library should NOT go in the prosilver style folder (be it lib or js, that is irrelevant from my POV) but in the all style folder, as it applies to any style. The template event code will be VERY style specific (prosilver, or other) but the library itself is generic.
Well, the first time I tried Twig throwed an exception, it was (as it should) looking into the template folders getting nothing, then I changed those lines as I said and as it is documented also here (now) ... -css-files
and worked, it also works (I did retry) following your above suggestion, dunno why it didn't the first time.
But I do prefer following the guidelines in order to avoid issues during validation, in case.
Not to mention that's faster.
Another method I see it should be used it is to create a PHP template switch in order to let the library load just in case, under permissions or so on. I don't see the reason why it should load also for BOTS or the like, that's my point of view.

About the "all" folder, your are probably (sure thing) right, but since I am not offering support for all styles but prosilver and with it based ones, I don't provide anything else that the prosilver folder into my extensions. If an user want to make the extension working for other style based or premium styles of any sort can copy/paste the prosilver one, rename it, hack it to fit their needs.
It is (by my experience too much of time consuming and efforts to offer support for somethig I don't know or like... hope you will understand my point of view).
javiexin wrote:If you need/want a hand with the style changes and library usage, let me know, and I will try to be more precise (PM me, as this might be not so much general interest).
Thanks, the code isn't in github (else I'd pointed you to it before). ATM it's private and I don't have yet permissions to share it.. but I think I need an hand about this template stuff.

Thanks again for everything.
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
Looking for a specific feature or alternative option? We will rock you! 🚀
Post Reply

Return to “Extension Writers Discussion”