What does {% and %} indicate about an event?

For support and discussion related to templates and themes in phpBB 3.3.
CarolC1
Registered User
Posts: 667
Joined: Sat Dec 02, 2006 4:26 pm

What does {% and %} indicate about an event?

Post by CarolC1 »

This is an example of an event.

Code: Select all

<!-- EVENT index_body_forumlist_body_after -->
What are these? Can you use them?

Code: Select all

{% EVENT viewforum_body_online_list_before %} 

Code: Select all

{% EVENT topiclist_row_topic_by_author_after %}
Thanks
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6353
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: What does {% and %} indicate about an event?

Post by thecoalman »

They do the same thing, The first is for phpBB's custom template engine and the second is for Twig. I would presume at some point the phpBB syntax will disappear,
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
CarolC1
Registered User
Posts: 667
Joined: Sat Dec 02, 2006 4:26 pm

Re: What does {% and %} indicate about an event?

Post by CarolC1 »

Fantastic! Thank you!! :D
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3911
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay

Re: What does {% and %} indicate about an event?

Post by Kailey »

Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules
If you have any questions about the rules/customs of this website, feel free to send me a PM.

My little corner of the world | Administrator @ phpBB Modders
CarolC1
Registered User
Posts: 667
Joined: Sat Dec 02, 2006 4:26 pm

Re: What does {% and %} indicate about an event?

Post by CarolC1 »

Thank you! It looks a bit advanced, but I'll at least give it a look. I know extension support is found in the Customise section, and my question is already answered, but I will explain what was going on. I have a validated extension written by someone else that creates a box element in a certain place on the index. I moved the box to display in another location by renaming the .html file found in the extension folder styles/prosilver/template/events to the name of an event that was located in the index template about where I wanted to locate the box, and the box showed up there. So that was on the index. So then I wanted to get the box showing in viewforum. The only event in the right area of viewforum to hook into was one of the (as explained above) Twig events(?), and when I used its name the box did not show. I tried again to be sure it wasn't a simple renaming error, but it still did not show. I finally ended up copying the code for the box right into viewforum.html so it is showing where I wanted it. I'll have to remember to update that code if we upgrade the extension. But it looks nice. So what I'm thinking is, the Twig event does not work the same way as the phpBB custom template engine event when you are trying to "plug" or "hook" your element into a different place in the template. Either way, I'm just happy it's working now. Did not mean to turn this into a styles support topic. Thanks again.
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3911
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay

Re: What does {% and %} indicate about an event?

Post by Kailey »

CarolC1 wrote: Wed Oct 30, 2024 1:41 am The only event in the right area of viewforum to hook into was one of the (as explained above) Twig events(?), and when I used its name the box did not show.
Did you purge the cache in the ACP after creating that file?

The phpBB template code is converted to twig before render, so twig is not the issue.
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules
If you have any questions about the rules/customs of this website, feel free to send me a PM.

My little corner of the world | Administrator @ phpBB Modders
CarolC1
Registered User
Posts: 667
Joined: Sat Dec 02, 2006 4:26 pm

Re: What does {% and %} indicate about an event?

Post by CarolC1 »

You were absolutely right. I must not have. I redid it again using the Twig style event in Viewforum and made sure to (duh!) purge the cache, and it worked perfectly. Thank you! :D

Return to “[3.3.x] Styles Support & Discussion”