Page 1 of 1

Is there ever a reason to change EVENT vars in templates?

Posted: Wed Mar 22, 2017 11:36 am
by kaspir
I was working with BBoots theme, helping a user get an extension of mine working. Quickly noticed that <!-- EVENT --> were renamed in that styles required template. Thus, not loading the extension event files.

The user informed me that he provided the original template. It could be a human mistake, but I'm asking this question anyways to ease my brain.

Is there ever a reason to change prosilver's original EVENTs in any template? To my knowledge, that's going to create many extension problems, is it not? :P Something I'm missing, if so I'm after that answer!

Thanks in advance!

Re: Is there ever a reason to change EVENT vars in templates?

Posted: Wed Mar 22, 2017 2:06 pm
by david63
The only reason that I can think of to change an event's name in a template would be if you wanted different behaviour at that point in different styles, but having said that if you used the different style names in an extension then you should be able to achieve the result

Re: Is there ever a reason to change EVENT vars in templates?

Posted: Wed Mar 22, 2017 3:04 pm
by kaspir
david63 wrote:
Wed Mar 22, 2017 2:06 pm
The only reason that I can think of to change an event's name in a template would be if you wanted different behaviour at that point in different styles, but having said that if you used the different style names in an extension then you should be able to achieve the result
What type of behavior can you alter? Forgive me, I only understood that events were to inject code from extensions. These events, BBoot just renamed original prosilver events. Same locations, different names.

To be more descriptive, that BBoot theme changed an EVENT (probably more that I've haven't seen, if not all of them) instead using this_event_prepend and this_event_append, they used this_event_prefix and this_event_postfix. Does this perform another type of behavior?

Achieving my result should be (possible last words!) accomplished, by simply renaming the event files of extension to the BBoot changed event(s) names. Shouldn't be any reason to change their original templates as long as the event exists. I was mearly curious as to why a theme artist would change them.

Thanks a bunch for the insight David.

Re: Is there ever a reason to change EVENT vars in templates?

Posted: Wed Mar 22, 2017 3:19 pm
by david63
kaspir wrote:
Wed Mar 22, 2017 3:04 pm
What type of behavior can you alter?
Say for example that you had two styles installed (prosilver and BBoots) and you wanted to add some css and the css was different for the two styles then you could add it to each style independent of the other if the events were named differently

Re: Is there ever a reason to change EVENT vars in templates?

Posted: Thu Mar 23, 2017 4:57 am
by kaspir
david63 wrote:
Wed Mar 22, 2017 3:19 pm
kaspir wrote:
Wed Mar 22, 2017 3:04 pm
What type of behavior can you alter?
Say for example that you had two styles installed (prosilver and BBoots) and you wanted to add some css and the css was different for the two styles then you could add it to each style independent of the other if the events were named differently
Interesting, I will have to research that more. BBoots dev wrote own core to the theme. What a headache this has been.. :)